Linux in a Nutshell, Third Edition
by Ellen Siever, Stephen Spainhour, Jessica P. Hekman, Stephen Figgins
Invoking the Shell
A shell command interpreter can be invoked as follows:
csh [options] [arguments] tcsh [options] [arguments]
csh and tcsh use syntax resembling C and execute commands from a terminal or a file. Options -n, -v, and -x are useful when debugging scripts.
Options
- -b
Allow the remaining command-line options to be interpreted as options to a specified command, rather than as options to csh itself.
- -c
Execute command specified following the argument.
- -d
Load directory stack from
~/.cshdirseven if not a login shell. (tcsh)- -e
Exit if a command produces errors.
- -f
Fast startup; start without executing .cshrc or .tcshrc.
- -i
Invoke interactive shell (prompt for input).
- -l
Login shell (must be the only option specified).
- -m
Load
~/.tcshrceven if effective user is not the owner of the file. (tcsh)- -n
Parse commands, but do not execute.
- -s
Read commands from the standard input.
- -t
Exit after executing one command.
- -v
Display commands before executing them; expand history substitutions, but not other substitutions (e.g., filename, variable, and command). Same as setting verbose.
- -V
Same as -v, but also display .cshrc.
- -x
Display commands before executing them, but expand all substitutions. Same as setting echo.
- -X
Same as -x, but also display .cshrc.
Arguments
Arguments are assigned, in order, to the positional parameters $1, $2, and so on. If the first argument is an executable script, commands are read from it, and remaining arguments are assigned to $1, $2, and so forth. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access