Notice! This document is currently in Archived status.
The content of this document may be incorrect or outdated.

Print this article Edit this article

Reserved Characters in Unix

Purdue Engineering Computer Network


Quoting disables a character's special meaning and allows it to be used literally as itself. The following characters have special meaning and must be quoted in order to use them literally.

 

;			Command separator
& Background execution
( ) Command grouping
| Pipe
* ? [ ] ~ Filename metacharacters
{ } String expansion characters. Usually don't require quoting.
> < & ! Redirection symbols
! ^ History substitution, quick substitution
" ' \ Using in quoting other characters
$ Variable substitution
newline space tab Word separators

The characters below can be used for quoting:

 

" "			Everything between " and " is taken literally, except
for the following characters that keep their
special meaning:
$ Variable substitution will occur
` Command substitution will occur
" This marks the end of the double quote
\ Escape next character
! The history character
newline The newline character
' ' Everything between ' and ' is taken literally except
for ! (history) and another ', and newline.

\ The character following a \ is taken literally. Use
within " " to escape ", $ and `. Often used to escape
itself, spaces, or newlines. Always needed to escape a
history character (usually !).

Examples

% echo 'Single quotes "protect" double quotes'
Single quotes "protect" double quotes

% echo "Well, isn't that \"special\"?"
Well, isn't that "special"?

% echo "The value of \$x is $x"
The value of $x is 100

Last Modified: Dec 19, 2016 11:12 am US/Eastern
Created: Aug 22, 2007 12:49 pm GMT-4 by admin
JumpURL: