|
|
The Bourne shell (sh) reads a single file in your home directory, the .profile. A typical Bourne shell .profile might look something like this:
1 : 2 # @(#) profile 23.1 96/04/03 3 # 4 # .profile -- Commands executed by a login Bourne shell 5 # 6 # Copyright (c) 1985-1998 The Santa Cruz Operation, Inc. 7 # All rights reserved. 8 # 9 # This Module contains Proprietary Information of the Santa Cruz 10 # Operation, Inc., and should be treated as Confidential. 11 #12 PATH=$PATH:$HOME/bin:. # set command search path 13 MAIL=/usr/spool/mail/`logname` # mailbox location 14 export PATH MAIL 15 # use default system file creation mask 16 eval `tset -m ansi:ansi -m :?${TERM:-ansi} -r -s -Q`
(C shells need to start Bourne shells to run Bourne shell scripts because they do not understand the Bourne shell language. The Korn shell, however, is compatible with the Bourne shell, so you can use most Bourne shell scripts in the Korn shell without a problem.)
`logname`
in backquotes tells the shell to substitute the
output of the command
logname(1),
which returns a user's login name.
Because `logname`
is used instead of a particular login name, this
script works for any user.
This tset command says
``check if this serial line is mapped to ansi in
the /etc/ttytype file;
if it is, set the terminal type to ansi.
Otherwise, prompt the user with TERM:ansi
.''
The -r option prints the terminal type on the screen,
-s exports the terminal type to any subshells,
and -Q suppresses the Erase set to ...
,
Kill set to ...
messages
that tset would otherwise show.
The tset command is enclosed in backquotes and preceded by the
shell command eval to guarantee that all necessary substitutions are
made within the tset command before it is evaluated by the shell.