Introduction to Unix

../_images/ksus5.jpg ../_images/UNIX_blocks5.jpeg

4.2. echo

echo

display a line of text. echo is often used to display or send an evironment variable to a pipe. (The Pipe (|), sed)

new=$(echo $old | sed 's/oldstring/newstring/')

SYNOPSIS

echo [OPTION]… [STRING]…

OPTIONS

-n

do not output the trailing newline

-e

enable interpretation of the backslash-escaped characters listed below

-E

disable interpretation of those sequences in STRINGs

4.2.1. Escaped Characters

\NNN the character whose ASCII code is NNN (octal)
\ \ backslash
\a alert (BEL)
\b backspace
\c suppress trailing newline
\f form feed
\n new line
\r carriage return
\t horizontal tab
\v vertical tab