next up previous
Next: Redirection Up: Shells Previous: Wildcards

Quoting

Some characters have special meanings to the shell. For instance, spaces are used to delimit arguments. A variety of quoting mechanisms allow special characters to be passed as arguments to a command.

\ quotes the next character. C-v also quotes control characters.

All characters within single quotes are taken literally, except '. ' may not be escaped with a \. Double quotes allow interpolation: variables and command substitutions are processed normally. They protect whitespace space and filename wildcards.

eg1$ touch 'A Filename With Spaces'
eg2$ rm A\ Filename\ With\ Spaces
eg3$ tar cf tar file file2
eg4$ tar cf "tar file" file2
eg5$ X="my data.tar"; tar cvf "$X" data/



Reece Kimball Hart
1998-03-18