Shell [Command Execution arithmetic extension/parameter processing preliminary usage]

1. Arithmetic Extension #! /Bin/bashx = 0 while ["$ X"-ne 10]; doecho $ xx = $ ($ x + 1) doneexit 0 2. Parameter Extension #! /Bin/bashfor I in 1 2; domkdir $ {I} _ tmpdoneexit 0 3. Processing Parameters #! /Bin/bashunset fooecho $ {FOO:-bar}

Linux Shell study Note 6

8 hours reference Terms Reference: The selected text is enclosed by some type of reference tag, so that the selected text becomes a text character.   Escape: escape a character means that a backslash (/) is added before the character to escape

Several groups of Shell-written progress bar programs

1. Add the $ symbol:#! /Bin/shEcho | awk '{printf "^) ^", $1 }'While sleep 1DoEcho "$" | awk '{printf "% s", $1 }'Done   2 changed sticks:#! /Bin/bash I = 0While [$ I-lt 10]DoFor J in '-''//'' | ''/'DoEcho-ne "/033 [1D $ J"Usleep 50000Done(I ++

Function inheritance in Shell

we know that variables are inherited by quilt processes, it can be used directly. In some cases, you may need to inherit functions to facilitate transparent use. The method is very simple. Use "Export-F". Pay attention to the parameter "-F", which

Run SQL in Linux Shell

Execute the SQL statement of the Oracle database in Shell #### Function #### Description: Execute an SQL statement ### input parameters: {SQL statement} {database TNS} {database user name} {Database User Password} #### output parameters: SQL

Safety Shell of Unit 1, Unit 3, nuclear power plant may be damaged

Beijing, March 16 (Xinhua)-the safety shell of nuclear reactors 1 and 3 at Fukushima 1st nuclear power plant may be damaged, Kyodo News reported, japan may need assistance from the US military. Yoy Nakano said Japan may seek help from the US

Shell 2> & 1

I have never been familiar with Shell and used to write command> log. log 2> & 1 when reporting error logs.Today, a colleague read my shell script and asked me what I meant by 2> & 1, which really gave me a hard time.After Google, I have a rough

[Linux] I just learned shell and encountered a problem. The total error occurred during execution: Unexpected Operator

I just learned shell and encountered a problem. The total error occurred during execution: Unexpected Operator. I used Ubuntu 9. 04. I learned from laruence to go to the shell script section, The script is as follows: #! /Bin/bash # Program: #  

Makefile & shell

The following are all from network collection. I sorted it out myself and only sorted out some things that I was not familiar with before, but will be used now:I. Definition of variables in makefile:1. recursive expansion: the variables defined by

"$ ()" In Linux Shell bash variable assignment

Reprinted: http://www.360doc.com/content/10/0303/16/155970_17438894.shtml Example 4-2. Simple variable assignment 1 #! /Bin/bash 2 # "naked" variable 3 4 Echo 5 6 # When is the variable "naked", such as when the front side is less than $? 7

Default variable of shell script ($0, $1 ...)

  Suppose I want to run a script with parameters. After running the script, the screen displays the following data: What is the program file name? How many parameters are there? If the number of parameters is smaller than 2, the user is notified

Write shell code

Write shell code The following is a shell C program shellcode. C: (this article takes Linux on intelx86 as an example) Void main (){Char * name [2]; Name [0] = "/bin/sh ";Name [1] = NULL;Execve (name [0], name, null );} Compile it as the Execution

Next-generation Windows Shell

A wonderful article on arstechnicaCommentThe replacement of cmd.exe under Windows is described in detail. Microsoft command shell, also known as MSH, and the project code is monad. From the comments, mshdoesn't just make cmd.exe unable to look

Notes on Linux Shell

1. query all files with no Suffix in the current directory: Find.-Type F-and! -Name "*.*" 2. query all files in the current folder that use the Windows Line Break (CRLF) and have no suffix. Use the-M parameter to convert them to Unix format (LF ).

Mathematical calculation of variables in Linux shell scripts

Let's start with an example: x=1+1echo $x Are you expecting output 2? Let you down. The output result is 1 + 1. Why? This is because the variable type in shell script is "string" by default, so if the variable type is not specified, 1 + 1 is a

A self-written shell script for automatic formatting, mounting upon startup, creating users and managing ACL Permissions

  At noon yesterday, after finishing learning ACL and mounting, I tried to write a small script. Suppose a group develops a project and needs to create a project group with three users and a shared folder, to prevent mutual modification or even

Shell script learning: Step-by-Step Basic awk statements, until loops, and test statements

Awk origin: awk statements are a set of languages developed by three researchers at Bell Labs in 1970s. awk names are the names and letters of the three researchers. However, awk was initially not intended for users, but for individual users.

Shell script programming: Linux automated logical volume creation script

Write a script to create and manage LV:Note: During script execution, a menu is displayed to the user, as shown in the following figure:A create an LV.B create an LV in an existing VG.C extend an LV.D reduce an LV. If you select item A, the

Enable the Windows GNU Emacs shell to start cygwin bash by default.

Victor, a friend of the district, told him that he planned to switch to the cygwin version of Emacs. In order to integrate the bash environment when he developed MTK more conveniently.   I also Google cygwin Emacs and other topics here .. The

System Monitoring: use shell to monitor the FTP service and use Feixin to send SMS alerts

#! /Bin/shlang = zh_cnsendmsgfile =/home/LSC/fetion/install/cmd.txt send_sms_mobile_telephone () {log_time = 'cat ftpstat_time 'local_time = 'date + % s' n =n ($ {local_time}-$ {log_time })) if ["$ N"-GT "1800"]; then # is more than 30 minutes away

Total Pages: 541 1 .... 531 532 533 534 535 .... 541 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.