echo - command used to display a line of text, message on screen and value of variables.
echo [option] [string… variables….]
echo Hello..!!!! echo “Hello Programmers…” //use quotations for string with blank spaces
echo $SHELL //will print the value of environment variable ‘SHELL’ i.e default shell of user echo “Default shell of user is $SHELL”
echo “Default shell of user is” $SHELL
By default, echo displays text/string and places a newline character at the end of it.
Avoids the trailing newline character
echo –n Hello
Enables interpretation of backslash escaped sequences (like \n \t) in the string
echo –e “Hello\tProgrammers”
Disables interpretation of backslash escaped sequences in the string
echo –E “Hello\tProgrammers”
Here \\ has further escaped the special meaning of \n sequence
Here 3 backspaces have been introduced.
Produce no further output
The further output Programmers and trailing newline has not been produced in above example
If you have any training enquiry then send mail at email@example.com.