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 staff@stacken.kth.se