Command Reference Guide

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man1/!!!intro.1
________________________________________________________________
___ ___
c
csh(1) csh(1)
Non-matching lists in bracket expressions are not supported.
In a list of words specifying file name substitution it is an error for no pattern to match an existing
file 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 files 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 file name (which is first variable, command and file 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, file 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 final newline which is dropped.
The resultant text is placed in an anonymous temporary file which is given to the com-
mand as standard input.
> name
>! name
>& name
>&! name The file name is used as standard output. If the file does not exist, it is created; if the
file exists, it is truncated, and its previous contents are lost.
If the variable noclobber is set, the file must not exist or be a character special file
(e.g., a terminal or /dev/null ) or an error results. This helps prevent accidental
destruction of files. 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
specified file as well as the standard output. name is expanded in the same way as <
input file names are.
>> name
>>& name
>>! name
>>&! name Uses file name as standard output the same as >, but appends output to the end of the
file. If the variable noclobber is set, it is an error for the file 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 modified by the input-output
parameters and the presence of the command in a pipeline. Thus, unlike some previous shells, commands
executed from a shell script have no access to the text of the commands by default; rather they receive the
original standard input of the shell. The << mechanism should be used to present inline data. This per-
mits shell scripts to function as components of pipelines and allows the shell to block-read its input.
HP-UX Release 11i: December 2000 15 Section 1143
___
___