csh(1)

csh(1)

rread access w write access x execute access e existence

o ownership z zero size f plain ®le d directory

The speci®ed ®lename is command- and ®le-name expanded then tested to see if it has the speci®ed relationship to the real user. If the ®le does not exist or is inaccessible, all inquiries return false (0). Command executions succeed, returning true, if the command exits with status 0; otherwise they fail, returning false. If more detailed status information is required, the command should be executed outside of an expression and the status variable examined.

Control of the Flow

csh contains a number of commands that can be used to regulate the ¯ow of control in command ®les (shell scripts) and (in limited but useful ways) from terminal input. These commands all operate by forcing the shell to reread or skip parts of its input and, due to the implementation, restrict the placement of some of the commands.

The foreach, switch, and while statements, as well as the if-then-elseform of the if statement require that the major keywords appear in a single simple command on an input line as shown below.

If the shell's input is not seekable, the shell buffers input whenever a loop is being read and performs seeks in this internal buffer to accomplish the rereading implied by the loop. (To the extent that this allows, backward gotos succeed on non-seekable inputs.)

Signal Handling

csh normally ignores quit signals. Jobs running in background mode are immune to signals generated from the keyboard, including hangups. Other signals have the values which the shell inherited from its parent. csh's handling of interrupts and terminate signals in shell scripts can be controlled by onintr. Login shells catch the terminate signal; otherwise this signal is passed on to children from the state in the shell's parent. In no case are interrupts allowed when a login shell is reading the ®le .logout.

Command Line Parsing

csh splits input lines into words at blanks and tabs. The following exceptions (parser metacharacters) are considered separate words:

&ampersand;

vertical bar;

;semicolon;

<less-than sign;

>greater-than sign;

( left parenthesis;

) right parenthesis; && double ampersand; double vertical bar; << double less-than sign;

>> double greater-than sign;

# comment delimiter

The backslash (\) removes the special meaning of these parser metacharacters. A parser metacharacter preceded by a backslash is interpreted as its ASCII value. A newline character (ASCII 10) preceded by a backslash is equivalent to a blank.

Strings enclosed in single or double quotes form parts of a word. Metacharacters in these strings, including blanks and tabs, do not form separate words. Within pairs of backslashes or quotes, a newline preceded by a backslash gives a true newline character.

When csh's input is not a terminal, the # character introduces a comment terminated by a newline.

CSH VARIABLES

csh maintains a set of variables. Each variable has a value equal to zero or more strings (words). Variables have names consisting of up to 80 letters and digits starting with a letter. The underscore character is considered a letter. The value of a variable may be displayed and changed by using the set and

HP-UX Release 11i: December 2000

− 11 −

Section 1139

c