MPE/iX Shell and Utilities Reference Manual, Vol 2
sh(1) MPE/iX Shell and Utilities sh(1)
Quoting
To let you override the special meaning of certain words or special characters, the shell pro-
vides several quoting mechanisms. In general, you can turn off the special meaning of any
character by putting a backslash (\) in front of the character. This is called escaping the char-
acter.
For example, you can tell the shell to disregard the special meaning of the newline character
by putting a backslash at the very end of a line. The shell ignores the escaped newline, and
joins the next line of input to the end of the current line. In this way, you can enter long lines
in a convenient and readable fashion.
Escaping characters by putting a backslash in front of them is the most direct way of telling
the shell to disregard special meanings; however, it can be awkward and confusing if you have
several characters to escape.
As an alternative, you can put arguments in various types of quotes. Different quote charac-
ters have different strengths. The apostrophe (single quote) characters are the strongest.
When you enclose a command line argument in apostrophes, the shell disregards the special
meanings of everything inside the apostrophes. For example,
echo ’*’
just displays the * character.
Double quote characters are weaker. Inside double quotes, the shell performs command sub-
stitutions of the form
$(command)
or
`command`
(See Command Substitution.) The shell does not perform such substitutions when they appear
inside apostrophes. In addition, the shell performs parameter substitutions of the form
$parameter
when they are inside double quotes but not when they’re inside apostrophes (see Parameter
Substitution). As well, you can use the backslash to escape another character when they
appear inside double quotes, but inside apostrophes, the shell ignore this special meaning.
The shell treats internal field separator characters (that is, characters in the value of the
IFS
variable) literally inside quoted arguments, whether they’re quoted with double quotes or
apostrophes. This means that a quoted argument is considered a single entity, even if it con-
tains
IFS
characters.
1-528 Commands and Utilities