Differences between revisions 1 and 2
Revision 1 as of 2008-02-17 21:24:54
Size: 520
Editor: 80-195-170-174
Comment: Initial import from Mark Hobley's Shell Programming Wiki
Revision 2 as of 2008-02-18 00:53:06
Size: 532
Editor: GreyCat
Comment: fix up wiki markup. some of it anyway.
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
In the shell, the *backslash* symbol serves the following purposes: In the shell, the '''backslash''' symbol serves the following purposes:
Line 5: Line 5:
==== Suppression of Interpolation ==== === Suppression of Interpolation ===
Line 9: Line 9:
{{{
Line 12: Line 13:
}}}

Backslash Symbol

In the shell, the backslash symbol serves the following purposes:

Suppression of Interpolation

The backslash symbol is be used to prevent [interpolation] of [metacharacters] by the shell. By prefixing the dollar [symbol] with a backslash [metacharacter], we prevent interpolation from taking place:

 price=300
 echo "Cost is $price dollars"   # Without the backslash $price is output as 300
 echo "Cost is \$price dollars"  # Interpolation of $price does not take place

BackSlash (last edited 2008-11-22 14:08:30 by localhost)