December 1999
Beginner
528 pages
11h 10m
English
Use echo to display lines of text or variables or to direct strings into files. The general format is:
echo string
The echo command comes with many features, but the most useful ones are as follows:
| \c | do not go to the next line |
| \f | formfeed |
| \t | tab |
| \n | newline |
To keep the prompt at the end of your string use:
$ echo "What is your name :\c"
$ read name
The output from the above would display:
What is your name :
where ‘
’ is the cursor.
To echo a string and let the cursor go to the next line use:
$ echo "The red pen ran out of ink" ...Read now
Unlock full access