Format:
#!/bin/bash: Flag a shell script
#Filename: first_shell.sh: File name
#auto: echo "Hello Shell": role
#by author h0f 2018-03-08: Author-date
echo "Hello Shell": Execute content
Execution: chmod o+x first_shell.sh
./first_shell.sh
Or:/bin/bash first_shell.sh
echo $? Determine if the last command was successful
Echo-e "\033[32mpleasse Select menu follow: \033[1m" color adjustment
/bin/bash 1_shell.sh
If Judgment statement number size
Determine if the file exists:
The first time does not exist, then creates, the second execution shows the existence OK
Note: 1 "." The same functionality as the source command, read-in script and execute script
Note: 2. Brackets [] must have at least one space at each end, as well as double brackets [[]]
3. The value of the string definition variable for a regular variable should be double-quoted, and there must be no spaces before and after the equals sign, which requires a strong reference (referred to as a WYSIWYG character reference) to use single quotation marks (").
If it is a reference to the command, use the back quotation marks (• )。
4. Single quotes, double quotes, and anti-quotes in all scripts must be symbols in the English state.
Shell Script Learning (1)