- Exit status
The built-in command in bash does not create a new process, but it also has the exit status, usually with 0 to indicate that a success nonzero indicates a failure, although the built-in command does not create a new process, but there is a status code after execution, or it can be read with a special variable $?
- Single quotation marks
The single and double quotation marks in a shell script are the same as the delimiter of the string, not the delimiter of the character. Single quotation marks are used to hold the literal value of all characters within the quotation marks, even if the \ and carriage returns within the quotation marks are no exception, but single quotes cannot appear in the string. If the quotation marks are entered without pairing, the shell gives a continuation prompt that asks the user to match the quotation marks. For example:
Echo ' Hello Word ' Hello Word[email protected]:~$
Echo ' Hello \> Word'hello word[email protected]:~$
- Double quotes
Double quotation marks are used to keep the literal value of all characters in quotation marks (carriage return is no exception), except in the following cases:
- $ plus variable name to take the value of the variable
- Anti-quotation marks still indicate command substitution
- \$ represents the literal value of $
- The literal value of \ ' representation '
- The literal value of \ "represents"
- \ \ denotes the literal value of \
[Email protected]:~$Echo$HOME/home/User[email protected]:~$Echo "' Date '"Sat Oct - +: to: $Cst the[email protected]:~$Echo "I ' d say: \ "Go for it\""I'D say: "Go for it"[Email protected]:~$Echo "\">""[email protected]:~$Echo "\\"[email protected]:~$
Tips for the basics of Shell programming