1.#!/bin/sh Use the SH program to execute the code below
#!/bin/more output the code below
The code below the #!/bin/executable will be used as input to this program
2. * Can be used to match file names, regular matches, as multiplication. * * can also be used as a power operation
3. (code) Can do mathematical operations, you can also add C code
4.$ can be a defined variable that can be a regular match line terminator, $$ represents the process ID of the current shell script
5. (code) is used to create a child shell to execute the contained code, and can also be used for array initialization
6.{} A bit like the distribution law, see example:
Cat {File1,file2,file3} > Combined_file # Connect file1,file2,file3 together and redirect to Combined_file
CP File22. {txt,backup} # Copy "File22.txt" to "File22.backup"
7.[[]] double brackets
①[[is a key word for the Bash programming language.] is not a command, [[]] structure is more general than [] structure. There is no filename extension or word splitting between all characters in [[and]], but parameter extensions and command substitution occur. ②supports pattern matching of strings, and even supports the shell's regular expressions when using the =~ operator. String comparisons can be made to the right as a pattern, not just a string, such as [[Hello = = Hell]], the result is true. Matches a string or wildcard character in [[]] without the need for quotation marks. ③use [[...]] The conditional judgment structure, rather than [...], can prevent many logic errors in the script. For example,The &&, | |, <, and > operators can normally exist in the [[]] conditional judgment structure, but if they appear in the [] structure, you will get an error. ④bash sees expressions in double brackets as a single element and returns an exit status code.
8.---see page 31
Shell Learning notes-Continuous logging