echo Command Explanation

Source: Internet
Author: User
Tags echo command echo display

echo Command: (refer to the man document for specific usage and explanation)

Feature Description: Display characters
Syntax: Echo [short-option] ... [String]

Echo long-option
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

String can use quotation marks, both single and double quotation marks can be

Where single quotes represent strong references, variable references are not replaced:

[Email protected]~]# echo ' $SHELL '

$SHELL

Double quotes represent weak references, and variables are replaced:

[Email protected]~]# echo "$SHELL"

/bin/bash


echo Display in Shell color display, echo display with color, need to use parameter-E

The format is as follows:

echo-e "\033[word background color; text color m string \033[0m"

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/84/94/wKioL1eVlvaBmmduAAATde1ZVos673.png "title=" 123451.png "alt=" Wkiol1evlvabmmduaaatde1zvos673.png "/>

of which the position represents the background, $ the position is the color of the representative word

Note:
1  , the word background color and the text color are in English"" 
2  , the text color is followed by am
3  , there can be no space before and after the string, if any, the output also has a space 
here is the corresponding word and background color, you can try to find out the different color collocation

echo-e "\033[31mRed Word\033[0m "
echo-e "\033[34mYellow Word\033[0m "
echo-e "\033[41;33mRed Bottom Yellow word\033[0m "
echo-e "\033[41;37mWhite on red background\033[0m "

The meanings indicated by the figures are as follows :

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/84/94/wKiom1eVmWCQFKRnAACaqvkFVEo042.png "title=" QQ picture 20160725124549.png "alt=" Wkiom1evmwcqfkrnaacaqvkfveo042.png "/>


Job : Use the echo command for flashing, underlining, and color functions

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/84/94/wKioL1eVknPCnBNLAAAZ0lTh5j0872.png "title=" Picture 5.png "alt=" Wkiol1evknpcnbnlaaaz0lth5j0872.png "/>


[Email protected] ~]# echo-e "\033[40;31;4;5m*******\n *****\n ***\n *\033[0m"

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/84/97/wKioL1eVshaAxPuXAAAT96yvj1o377.png "title=" QQ picture 20160725143120.png "alt=" Wkiol1evshaaxpuxaaat96yvj1o377.png "/>

echo Command Explanation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.