Shell Script Learning (i)
A) Introduction to code-style shell scripts
1. Download Xshell 5
Build a folder Mkdri Home/data;
1) Look at a 1.sh built in data
See if the build was successful.
2) and edit echo Hello Word, and save the launch
3) No permissions were found when running the script. Add permissions.
"' Green executable script
II) shell script commands
1> Download Everedit Editor, other editors can also
After installation
2> variables:
1. When no that variable is the result value is empty, the value of ${name} parentheses can be added without
2.readonly system, non-reproducible, final in ==java
3) Delete variable cannot be used
-
- 1) local variable local variables are defined in a script or command, only valid in the current shell instance, and other shell-initiated programs cannot access local variables.
- 2) Environment variables All programs, including shell-initiated programs, can access environment variables, and some programs require environment variables to keep them running properly. Shell scripts can also define environment variables when necessary.
- 3) shell variables shell variables are special variables that are set by the shell program. Some of the shell variables are environment variables, some of which are local variables that guarantee the shell's normal operation.
4) The difference between "and" "
5) Intercept string length
6) Find the location of the string (only the first one can be found, the duplicates cannot be found)
7) array
8) for Loop
Operation
9) Add
10) Subtraction Yu
One) if Then
12) Relational operators
13) Logical operators
14)
Shell Script Learning (i)