Invokes the C shell.
csh [ -v | -V ] [ -x | -X ] [ -e ] [ -f ] [ -i ] [ -n ] [ -c String | -s | -t ] [ -b ] [ File [ Parameter ] ]
The C shell is an interactive command interpreter and a command programming language that uses syntax similar to the C programming language. The shell carries out commands either interactively from a terminal keyboard or from a file. The csh command invokes the C shell.
When you invoke the csh command, it begins by looking in your home directory and executing commands from the .cshrc file (used to store customized user information) if it exists. If the csh command runs as a login shell, it executes commands from your .cshrc and .login files.
After the shell processes flag arguments, if neither the -i, -c, -s, nor -t flag is specified and the File [Parameter] is specified, then the shell executes the script file identified by the File [Parameter], including any parameters specified. The script file specified must have read permission; the shell ignores any setuid and setgid settings.
Note: You should not specify a script file if you use the csh command with either the -c or -s flag.
If you specify a script file, the command opens the file and saves the script file name for possible resubstitution by $0 (dollar sign, zero). The script will then be carried out by csh. Remaining parameters initialize the argv variable.
Notes:
- If C shell is already running, the .cshrc file can be read again by typing source Pathname, where the Pathname parameter is the path to the .cshrc file.
- To avoid problems with remote operations, the .cshrc file should not contain any functions that echo output unless they test for the $prompt variable, which signifies that the shell is interactive. Otherwise, whenever a remote system uses the exec command on a command sent by the local system, both the command and the shell are carried out. For example, exec csh rcp -t Filename executes the .cshrc file and treats the echoed output as the expected response. An if clause can be used to check for the $prompt variable.
If the first argument to a shell is a - (minus sign), that shell is a login shell. The C shell flags are interpreted as follows:
$HOME/.cshrc | Read at the beginning of execution by each shell. The .cshrc file is user-defined. |
$HOME/.login | Read by the login shell after the .cshrc file at login. |
$HOME/.logout | Read by the login shell at logoff. |
/usr/bin/sh | Contains the path to the default shell. |
/tmp/sh* | Contains the temporary file for <<. |
/etc/passwd | Contains the source of home directories for the ~File parameter. |
The bsh command, chuser command, ksh command, sh command.
The environment file.
C Shell in AIX 5L Version 5.2 System User's Guide: Operating System and Devices.