home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

Book HomeLinux in a NutshellSearch this book

8.3. Syntax

This section describes the many symbols peculiar to csh and tcsh. The topics are arranged as follows:

  • Special files

  • Filename metacharacters

  • Quoting

  • Command forms

  • Redirection forms

8.3.3. Quoting

Quoting disables a character's special meaning and allows it to be used literally, as itself. The following characters have special meaning to the C shell:

Characters Description
; Command separator
& Background execution
( ) Command grouping
| Pipe
* ? [ ] ~ Filename metacharacters
{ }

String expansion characters (usually don't require quoting)

> < & ! Redirection symbols
! ^ History substitution, quick substitution
" ' \ Used in quoting other characters
` Command substitution
$ Variable substitution

newline space tab

Word separators

The characters that follow can be used for quoting:

" "

Everything between " and " is taken literally, except for the following characters, which 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.


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 "You have `ls|wc -l` files in `pwd`"
You have 43 files in /home/bob

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

8.3.5. Redirection Forms

File Descriptor


Common Abbreviation

Typical Default

0 Standard input stdin Keyboard
1 Standard output stdout Screen
2 Standard error stderr Screen

The usual input source or output destination can be changed with redirection commands listed in the following sections.

Library Navigation Links

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