2018-12-17 01:39:33 +00:00
|
|
|
echo - display a line of text
|
|
|
|
==========================================
|
|
|
|
|
2018-12-18 01:58:24 +00:00
|
|
|
Synopsis
|
|
|
|
--------
|
2018-12-16 21:08:41 +00:00
|
|
|
|
|
|
|
echo [OPTIONS] [STRING]
|
2018-12-18 01:58:24 +00:00
|
|
|
|
2018-12-16 21:08:41 +00:00
|
|
|
|
2018-12-19 02:44:30 +00:00
|
|
|
Description
|
|
|
|
------------
|
2018-12-16 21:08:41 +00:00
|
|
|
|
|
|
|
`echo` displays a string of text.
|
|
|
|
|
|
|
|
The following options are available:
|
|
|
|
|
|
|
|
- `-n`, Do not output a newline
|
|
|
|
|
|
|
|
- `-s`, Do not separate arguments with spaces
|
|
|
|
|
|
|
|
- `-E`, Disable interpretation of backslash escapes (default)
|
|
|
|
|
|
|
|
- `-e`, Enable interpretation of backslash escapes
|
|
|
|
|
2018-12-19 02:44:30 +00:00
|
|
|
Escape Sequences
|
|
|
|
------------
|
2018-12-16 21:08:41 +00:00
|
|
|
|
|
|
|
If `-e` is used, the following sequences are recognized:
|
|
|
|
|
|
|
|
- `\` backslash
|
|
|
|
|
|
|
|
- `\a` alert (BEL)
|
|
|
|
|
|
|
|
- `\b` backspace
|
|
|
|
|
|
|
|
- `\c` produce no further output
|
|
|
|
|
|
|
|
- `\e` escape
|
|
|
|
|
|
|
|
- `\f` form feed
|
|
|
|
|
|
|
|
- `\n` new line
|
|
|
|
|
|
|
|
- `\r` carriage return
|
|
|
|
|
|
|
|
- `\t` horizontal tab
|
|
|
|
|
|
|
|
- `\v` vertical tab
|
|
|
|
|
|
|
|
- `\0NNN` byte with octal value NNN (1 to 3 digits)
|
|
|
|
|
|
|
|
- `\xHH` byte with hexadecimal value HH (1 to 2 digits)
|
|
|
|
|
2018-12-19 02:44:30 +00:00
|
|
|
Example
|
|
|
|
------------
|
2018-12-16 21:08:41 +00:00
|
|
|
|
2018-12-19 03:14:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
echo 'Hello World'
|
|
|
|
|
2018-12-16 21:08:41 +00:00
|
|
|
Print hello world to stdout
|
|
|
|
|
2018-12-19 03:14:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
echo -e 'Top\\nBottom'
|
|
|
|
|
2018-12-16 21:08:41 +00:00
|
|
|
Print Top and Bottom on separate lines, using an escape sequence
|