Unix Power ToolsUnix Power ToolsSearch this book

27.13. Differences Between Bourne and C Shell Quoting

This article explains quoting in C-type shells by comparing them to Bourne-type shell quoting. If you haven't read Section 27.12 about Bourne shell quoting, please do so now.

As in the Bourne shell, the overall idea of C shell quoting is this: quoting turns off (disables) the special meaning of characters. There are three quoting characters: a single quote ('), a double quote ("), and a backslash (\).

27.13.1. Special Characters

The C shell has a few more special characters in addition to the original Bourne shell:

! { } ~

27.13.2. How Quoting Works

Table 27-2 summarizes the rules; you might want to look back at it while you read the examples.

Table 27-2. C shell quoting characters

Quoting character

Explanation

'xxx'

Disable all special characters in xxx except !.

"xxx"

Disable all special characters in xxx except $, ', and !.

\x

Disable special meaning of character x. At end of line, a \ treats the newline character like a space (continues line).

The major differences between C and Bourne shell quoting are the following:

-- JP



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.