Words do not say much, straight to the subject, LZ is not bad at writing an article, just record their own learning process in a bit drops.
Note: The shell is sensitive to case letters.
Open terminal appears: [email protected]$ Span style= "font-family: the song Body;" > or [email protected]# $ # $ # root linuxsystem root shell
Two ways to run the script:
First type:$ bash script.sh or $ bash/home/path/script.sh # text comment, in current directory
The second type: Set script executable permissions,$ chmod a+x script.sh meaning is to give all users script.sh file executable permissions, execution mode:
$./script.sh #./ represents the current directory
Or
$/home/path/script.sh
In Bash , each command is delimited by using a semicolon or a newline.
Cd.. go to the previous level directory ( Note: There is a space in the middle, and the DOS Command of window is a little different window DOS command CD below: and the CD.. can go back to the previous level of the directory )
Terminal Print Basic command: Echo
Text output can be printed directly on the terminal by either double quotation marks or single quotation marks.
Practical demonstrations such as:
But there are side effects to this red box, so the solution is to output directly, use single quotes, or escape characters (\).
Induction:
When you use echo without single quotes , you can't use semicolons in your text (;), because semicolons are used as command qualifiers in the Bash Shell .
Variable substitution is not valid in single quotes, post-discussion.
Initial knowledge of the shell