CSHRC(5-BSD) RISC/os Reference Manual CSHRC(5-BSD)
NAME
cshrc - startup file for csh command
SYNOPSIS
$HOME/.cshrc
DESCRIPTION
When csh(1) is executed without the option -f, it reads com-
mands from the file $HOME/.cshrc. If the shell is a login
shell (this can be done by logging in, executing the
login(1) command, or executing su(1M) with the - option),
the file $HOME/.login is executed after the .cshrc file.
This file should do the following:
Set the PATH variable (this must be here if rsh(1C) or
rcp(1C) is to work properly. If these are not required,
the PATH may be set in the file $HOME/.login).
Set up aliases (interactive shells only).
Set up internal csh variables for things like line
editing, filename completion, history, etc (interactive
shells only).
Set the prompt to be used when the shell is invoked as
a non-login shell (interactive shells only).
In general, the format of the file is as follows (items in
{} should be replaced by appropriate commands and/or path-
names):
set path=( . \
{personal bins} \
{local/project bins} \
$PATH \
/usr/new \
/usr/new/mh \
)
set cdpath=( {path for use with cd command} )
if ($?prompt) then
{set prompt}
{set variables and aliases for interactive shells}
else
{set variables and aliases for non-interactive shells}
endif
{set variables and aliases for all shells}
The PATH environment variable set by the .cshrc determines
whether your environment will behave like a System V or a
Printed 11/19/92 Page 1
CSHRC(5-BSD) RISC/os Reference Manual CSHRC(5-BSD)
BSD environment, depending on the order in which /bin,
/usr/bin, /bsd43, and /usr/ucb are placed. For more infor-
mation on these directories and the PATH variable, refer to
the Guide to Using BSD on RISC/os.
There is almost never a reason to execute any commands in
this file other than those for setting up variables and
aliases. Special care should be taken to avoid executing
commands like biff(1), sysline(1), or tset(1), especially in
non-interactive shells.
Environment variables can be set in $HOME/.login at login
time, since they are passed to all subshells. In fact, set-
ting environment variables in .cshrc can cause unexpected
results.
An example of a useful .cshrc file is:
#!/bin/csh -f
# .cshrc for root
set path = (/bsd43/bin /usr/ucb /bin /usr/bin /etc .)
# Things for interactive shells
if ($?prompt) then
alias j jobs -l
alias h history
alias z suspend
set history=100
else
# nothing for non-interactive shells
endif
SEE ALSO
profile(5).
csh(1), login(1) in the User's Reference Manual.
su(1M) in the System Administrator's Reference Manual.
Guide to Using BSD on RISC/os.
Page 2 Printed 11/19/92