c

csh(1)

csh(1)

It should be possible to use the : modi®ers on the output of command substitutions. All and more than

one : modi®er should be allowed on $ substitutions.

Terminal type is examined only the ®rst 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 certain attendant dangers, particularly when using range expressions in ®le name generation patterns. For example, the command,

rm [a-z]*

might be expected to match all ®le names beginning with a lowercase alphabetic character. However, if dictionary ordering is speci®ed by LC_COLLATE, it would also match ®le names beginning with an uppercase 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 speci®c 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-NLSenvironment. 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 ®le 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-UXRelease 9.0, csh, when getting its input from a ®le, would exit immediately if unable to execute a command (such as if it was unable to ®nd the command). Beginning at Release 9.0, csh continues on and attempts to execute the remaining commands in the ®le. However, if the old behavior is desired for compatibility purposes, set the environment variable EXITONERR to 1.

AUTHOR

csh was developed by the University of California, Berkeley and HP.

FILES

A csh script sourced (executed) at the beginning of execution by each shell. See

Ä/.cshrc

 

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 #.

/etc/csh.login

A csh script sourced (executed) before Ä/.cshrc and Ä/.login when start-

 

ing a csh login (analogous to /etc/profile in the Bourne shell).

/tmp/sh*

Temporary ®le for <<.

SEE ALSO

cd(1), echo(1), kill(1), nice(1), sh(1), umask(1), access(2), exec(2), fork(2), pipe(2), umask(2), wait(2), tty(7), a.out(4), environ(5), lang(5), regexp(5).

C Shell tutorial in Shells Users Guide.

Section 1146

− 18 −

HP-UX Release 11i: December 2000