PROFILE(5) RISC/os Reference Manual PROFILE(5)
NAME
profile - login file for sh command
SYNOPSIS
$HOME/.profile
DESCRIPTION
When sh(1) is executed as a login shell (by logging in, exe-
cuting login(1), or by executing su(1) with the - option),
the file $HOME/.profile is read for commands to execute
This file should be used to do things like the following:
Set environment variables, such as PATH and EDITOR.
Set up the terminal.
Set up functions.
Set up speed- and host-specific functions and vari-
ables.
Set up a login shell prompt (useful for distinguishing
login shells and non-login shells).
In general, the format of the file is as follows (items in
{} should be replaced by appropriate commands and/or path-
names):
{set up terminal; more details on this below}
{set environment variables and functions}
case `stty speed` in
speed1)
{set environment variables and functions}
;;
...
esac
HOST=`hostname`
case "$HOST" in
host1)
{set environment variables and functions}
;;
...
esac
Setting up the terminal consists of two steps: setting the
tty attributes and setting the terminal capability variables
(for use by screen-oriented programs). The first step is
achieved by executing the command stty(1). For example, the
Printed 1/15/91 Page 1
PROFILE(5) RISC/os Reference Manual PROFILE(5)
following command sets the terminal up as a CRT (erase out-
puts spaces to erase characters, control characters echo as
^X), sets the erase character to ^H, and sets the interrupt
character to ^C.
stty crt erase intr
The next step is accomplished by using the command tset(1).
The following series of commands set the environment vari-
able TERM to the type of the terminal, and the variable
TERMCAP to the entry from a termcap database file (default
is /etc/termcap). It assumes that the terminal type for a
hard line is in /etc/ttys, and that the terminal typically
used for dialup is a vt100.
set -f
eval `tset -s -Q -m 'dialup:?vt100' -m "${TERM}:$TERM"`
set +f
Basically, the above says ``if the terminal is a dialup, ask
the user if the terminal type is a vt100, otherwise, use the
variable of the TERM variable; don't print the state of the
erase, kill, and interrupt characters (-Q option); print out
commands to set the environment variables TERM and TERMCAP
(-s option)''.
SEE ALSO
sh(1), stty(1), su(1), tset(1), cshrc(5), profile(5),
ttys(5)
Page 2 Printed 1/15/91