HP-UX Reference (11i v2 04/09) - 1 User Commands A-M (vol 1)

c
csh(1) csh(1)
Command Line Control
A ˆR re-prints the current command line;
ˆW erases the last word entered on the current command line.
Sanity
C shell restores your terminal to a sane mode if it appears to return from some command in raw, cbreak,
or noecho mode.
Saving Your History Buffer
csh has the ability to save your history list between login sessions. If the shell variable
savehist is
set to a number, that number of command events from your history list is saved. For example, placing
the line
set history=10 savehist=10
in your .cshrc file maintains a history buffer of length 10 and saves the entire list when you logout.
When you log back in, the entire buffer is restored. The commands are saved in the file
.history in
your login directory.
EXTERNAL INFLUENCES
Environment Variables
LC_COLLATE determines the collating sequence used in evaluating pattern matching notation for file
name substitution.
LC_CTYPE determines the interpretation of text as single and/or multi-byte characters, the classification
of characters as letters, and the characters matched by character class expressions in pattern matching
notation.
LANG determines the language in which messages are displayed.
If
LC_COLLATE or LC_CTYPE is not specified in the environment or is set to the empty string, the value
of LANG is used as a default for each unspecified or empty variable. If
LANG is not specified or is set to
the empty string, a default of "C" (see lang(5)) is used instead of
LANG. If any internationalization vari-
able contains an invalid setting, csh behaves as if all internationalization variables are set to "C". See
environ(5).
International Code Set Support
Single- and multi-byte character code sets are supported.
WARNINGS
The
.cshrc file should be structured such that it cannot generate any output on standard output or
standard error, including occasions when it is invoked without an affiliated terminal. rcp(1) causes
.cshrc to be sourced, and any output generated by this file, even to standard error causes problems.
Commands such as stty (1) should be placed in .login, not in .cshrc, so that their output cannot affect
rcp(1).
csh has certain limitations. Words or environment variables can be no longer than 10240 characters.
The system limits argument lists to 10240 characters. The number of arguments to a command which
involves file name expansion is limited to one-sixth the number of characters allowed in an argument list.
Command substitutions may substitute no more characters than are allowed in an argument list.
To detect looping, the shell restricts the number of
alias substitutions on a single line to 20.
When a command is restarted from a stop,
csh prints the directory it started in if it is different from the
current directory; this can be misleading (i.e., wrong) because the job may have changed directories inter-
nally.
Shell built-in functions are not stoppable/restartable. Command sequences of the form
a;b;c
are
also not handled gracefully when stopping is attempted. If you interrupt
b, the shell then immediately
executes c. This is especially noticeable if this expansion results from an alias. It suffices to place the
sequence of commands in parentheses to force it into a subshell; i.e., (a;b;c).
Because of the signal handling required by csh, interrupts are disabled just before a command is exe-
cuted, and restored as the command begins execution. There may be a few seconds delay between when a
command is given and when interrupts are recognized.
Control over tty output after processes are started is primitive; perhaps this will inspire someone to work
on a good virtual terminal interface. In a virtual terminal interface much more interesting things could
be done with output control.
HP-UX 11i Version 2: September 2004 − 17 − Hewlett-Packard Company Section 1−−163