Example of removing special meaning from a metacharacter

Example of removing special meaning from a metacharacter

To make the shell interpret a metacharacter literally:

   echo &
   [1] 1463
   [1]    Done                 echo
   echo \\&
   &

The shell interprets the & character at the end of a command line to mean that the command is to be run in the background. So the command echo & simply runs the echo command in the background and since the command has nothing to echo it immediately exits.

When the & character is preceded by a \\ (backslash) the echo command interprets this literally and simply echoes (displays) this character on the screen.


[Home] [Search] [Index] This site maintained by unixhelp@math.rutgers.edu
This page was last updated on September 05, 2006 at 10:29 am and is maintained by webmaster@math.rutgers.edu.
For questions regarding courses and/or special permission, please contact mclausen@math.rutgers.edu.
For questions or comments about this site, please contact help@math.rutgers.edu.
© 2012 Rutgers, The State University of New Jersey. All rights reserved.