Tuesday, December 6, 2011

The echo command

The echo command echoes its arguments separated by blanks and terminated by a new line on the standard output.
Syntax:
              echo [arg] 
              echo[-n][arg]


The /user/bin/sh version understands the following C-like escape sequences:
 \b  backspace
 \c  print line without newline
\n   new--line
\r    carriage return
\t    tab
\v   vertical tab
\\    backslash
\n   where n is the 8 bit character whose ASCII code is the 1,2or 3 digit octal number representing that character.

The following option is available to /usr/bin/sh users only if /usr/ucb preceeds /usr/bin in the user's path.It is available to  /usr/csh users regardless of the PATH:
-n  Do  not add newline to the output

The echo command is useful for producing diagnostics in command files, for sending known data into a pipe, and for displaying the contents of environment variables.

The next command will be bc which is an arbitrary-precision arithmetic language in unix