|
echo is the basic command for the terminal to print. Use the following:
$ Echo "hello world"
$ Echo hello world
$ Echo 'hello world'
$ Echo $ PATH
[Name Description]
By default, it echoes at the end of each line will add a number of line breaks; use -n option to ignore trailing newline;
(!) Exclamation point is a special symbol, if the string has an exclamation mark, it should not be placed in double quotes (""), you can not use double quotes or single quotes, you can also use an escape character; as follows:
$ Echo hello world!
$ Echo 'hello world!'
$ Echo "hello world \!"
When using the echo command without quotation marks, you can not print a semicolon (;), because the semicolon in the bash shell is used as a command delimiter;
When using single quotes ('') of the echo command, baseh not single quotes variable ($ var) evaluated, but only as it is output;
$ Echo 'hello, $ vName.'
hello, $ vName # output of the line.; |
|
|
|