HP-UX Reference (11i v2 07/12) - 1 User Commands A-M (vol 1)
c
csh(1) csh(1)
Commands within loops, prompted for by ?
, are not placed in the history list. Control structure should be
parsed rather than being recognized as built-in commands. This would allow control commands to be
placed anywhere, to be combined with
|, and to be used with
& and ; metasyntax.
It should be possible to use the
:
modifiers on the output of command substitutions. All and more than
one
: modifier should be allowed on
$ substitutions.
Terminal type is examined only the first time you attempt recognition.
To list all commands on the system along
PATH, enter [Space]-[Ctrl]-[D]
.
The csh metasequence
!˜ does not work.
In an international environment, character ordering is determined by the setting of
LC_COLLATE ,rather
than by the binary ordering of character values in the machine collating sequence. This brings with it cer-
tain attendant dangers, particularly when using range expressions in file name generation patterns. For
example, the command,
rm [a-z]*
might be expected to match all file names beginning with a lowercase alphabetic character. However, if
dictionary ordering is specified by
LC_COLLATE , it would also match file names beginning with an upper-
case character (as well as those beginning with accented letters). Conversely, it would fail to match letters
collated after z in languages such as Norwegian.
The correct (and safe) way to match specific character classes in an international environment is to use a
pattern of the form:
rm [[:lower:]]*
This uses LC_CTYPE to determine character classes and works predictably for all supported languages and
codesets. For shell scripts produced on non-internationalized systems (or without consideration for the
above dangers), it is recommended that they be executed in a non-NLS environment. This requires that
LANG, LC_COLLATE, etc., be set to "C" or not set at all.
csh implements command substitution by creating a pipe between itself and the command. If the root file
system is full, the substituted command cannot write to the pipe. As a result, the shell receives no input
from the command, and the result of the substitution is null. In particular, using command substitution for
variable assignment under such circumstances results in the variable being silently assigned a NULL value.
Relative path changes (such as cd ..), when in a symbolically linked directory, cause csh
’s knowledge of
the working directory to be along the symbolic path instead of the physical path.
Prior to HP-UX Release 9.0,
csh, when getting its input from a file, would exit immediately if unable to
execute a command (such as if it was unable to find the command). Beginning at Release 9.0,
csh contin-
ues on and attempts to execute the remaining commands in the file. However, if the old behavior is desired
for compatibility purposes, set the environment variable
EXITONERR to 1.
When
LARGESCRIPTS is defined, the shell retains as little input as possible in memory. Thus, certain
constructs like goto, that involve rewinding of the shell’s input, may not work properly.
Non-interactive shells will not read the
˜/.history file at the beginning of execution. If required by the
script, the
˜/.history file needs to be read explicitly, using the source command.
AUTHOR
csh was developed by the University of California, Berkeley and HP.
FILES
˜/.cshrc A csh script sourced (executed) at the beginning of execution by each shell. See
WARNINGS.
˜/.history A csh script read at the beginning of the execution by an interactive shell. See
WARNINGS.
˜/.login A csh script sourced (executed) by login shell, after .cshrc at login.
˜/.logout A csh script sourced (executed) by login shell, at logout.
/etc/passwd Source of home directories for ˜name.
/usr/bin/sh Standard shell, for shell scripts not starting with a #.
210 Hewlett-Packard Company − 18 − HP-UX 11i Version 2: December 2007 Update