csh(1) | csh(1) |
∙
∙In a list of words specifying ®le name substitution it is an error for no pattern to match an existing ®le name, but it is not required for each pattern to match.
∙The metanotation a{b,c,d}e is a shorthand for "abe ace ade". Left to right order is preserved, with results of matches being sorted separately at a low level to preserve this order. This construct may be nested. Thus:
~source/s1/{oldls,ls}.c
expands to
/home/source/s1/oldls.c /home/source/s1/ls.c
whether or not these ®les exist, without any chance of error if the home directory for source is /home/source . Similarly,
../{memo,*box}
might expand to
../memo ../box ../mbox
(Note that memo was not sorted with the results of matching *box.) As a special case, {, }, and
{} are passed undisturbed.
Input/Output
The standard input and standard output of a command can be redirected with the following syntax:
< name | Open ®le name (which is ®rst variable, command and ®le name expanded) as the stan- |
| dard input. |
<<word Read the shell input up to a line which is identical to word. word is not subjected to variable, ®le name or command substitution, and each input line is compared to word before any substitutions are done on this input line. Unless a quoting \, ', or Á appears in word, variable and command substitution is performed on the intervening lines, allowing \ to quote $, \ and Á. Commands which are substituted have all blanks, tabs, and newlines preserved, except for the ®nal newline which is dropped. The resultant text is placed in an anonymous temporary ®le which is given to the com- mand as standard input.
>name >! name >& name
>&! name The ®le name is used as standard output. If the ®le does not exist, it is created; if the
®le exists, it is truncated, and its previous contents are lost.
If the variable noclobber is set, the ®le must not exist or be a character special ®le (e.g., a terminal or /dev/null) or an error results. This helps prevent accidental destruction of ®les. In this case the exclamation point (!) forms can be used to suppress this check.
The forms involving the ampersand character (&) route the standard error into the speci®ed ®le as well as the standard output. name is expanded in the same way as < input ®le names are.
>>name >>& name >>! name
>>&! name Uses ®le name as standard output the same as >, but appends output to the end of the
®le. If the variable noclobber is set, it is an error for the ®le not to exist unless one of the ! forms is given. Otherwise, it is similar to >.
A command receives the environment in which the shell was invoked as modi®ed by the
c
− 15 − | Section 1−143 |