Полезная информация

UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 8.14 Bourne Shell Quoting Chapter 8
How the Shell Interprets What You Type
Next: 8.16 Quoting Handles Special Characters in Filenames
 

8.15 Differences Between Bourne and C Shell Quoting

This article explains quoting in the C shell by comparing it to Bourne shell quoting. If you haven't read article 8.14 about Bourne shell quoting, please do.

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

8.15.1 Special Characters

The C shell has several more special characters than the Bourne shell:

! { } ~

8.15.2 How Quoting Works

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

Table 8.2: C Shell Quoting Characters
Quoting CharacterExplanation
'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:

- JP


Previous: 8.14 Bourne Shell Quoting UNIX Power ToolsNext: 8.16 Quoting Handles Special Characters in Filenames
8.14 Bourne Shell Quoting Book Index8.16 Quoting Handles Special Characters in Filenames

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System