The echo command for Linux, which is very common in shell programming, is often used when printing variable value under a terminal, so it is necessary to understand the use of Echo
The function of the echo command is to display a piece of text on the display, which generally acts as a hint.
The general format of the command is: Echo [-n] String
where option n means that the output text is not wrapped, the string can be quoted, or it can be unquoted. When you output a quoted string with the Echo command, the string is output as it is, and when you output an unquoted string with the echo command, each word in the string is output as a string, separated by a space between the strings.
Feature Description: Displays text.
Syntax: Echo [-ne][string] or echo [--help][--version]
Additional note: Echo will send the input string to standard output. The output strings are separated by white space characters, and a newline number is added at the end.
Parameter:-n do not wrap in the last line
-E If the following characters appear in the string, they are handled in particular, not as a general
Text output:
\a issued a warning sound;
\b Delete the previous character;
\c finally not add the line break symbol;
\f the line but the cursor remains in its original position;
\ n Wraps and the cursor moves to the beginning of the line;
\ r The cursor moves to the beginning of the line, but does not wrap;
\ t Insert tab;
\v is the same as \f;
\ \ insert \ character;
\NNN inserts the ASCII character represented by the NNN (octal);
Help Display Help
–version displaying version information
-----------------------------------------------------------------------------------------------
The echo command for Linux is extremely common in shell programming and is often used when printing variable value under a terminal.
For example: Echo can be used as a display note for some batch commands that need to be commented to the user, such as the previous command execution will take a long time, often with echo display a message to let the user know this time is slow, a little wait.
The echo command in Linux is used to display a section of characters on the standard output, such as:
echo "The echo command test!"
This will output "the echo command test!." This line of text!
echo "The echo command test!" >a.sh
This will output "the echo command test!" in the a.sh file. This line of text! The general format of the command is: Echo [-n] string where option n means that the output text is not wrapped, the string can be quoted, or it can be unquoted. When you output a quoted string with the Echo command, the string is output as it is, and when you output an unquoted string with the echo command, each word in the string is output as a string, separated by a space between the strings.
The echo command for Linux