home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World Interactive 1996 May
/
PCW_MAY_1996_LINUX_UKUUG.ISO
/
etc
/
profile
< prev
next >
Wrap
Text File
|
1995-03-03
|
3KB
|
111 lines
# /etc/profile
# Commands to execute each time someone logs in in a bourne shell
# Note that login initializes environment variables from /etc/ENVIRONMENT.
#
#IFS='
#'
#set -x
#echo "TERM=${TERM-}"
trap exit 15
umask 0022
if [ -z "${SHELL-unset}" ]; then
SHELL=/bin/sh; export SHELL
fi
alias which=type
alias cd..="cd .."
# PWD may be set by ksh and is not maintained by sh.
# Unset it and create it as local variable
unset PWD; cd .
case "${TERM-}" in
@*@*)
case "${DISPLAY-}" in
'')
DISPLAY="`echo "$TERM" | /bin/sed 's/@[^@]*@\(.*\)/\1/'`"; export DISPLAY
WINDOWID="`echo "$TERM" | /bin/sed 's/@\([^@]*\)@.*/\1/'`"; export WINDOWID
;;
esac
unset TERM
;;
*@*@*)
case "${DISPLAY-}" in
'')
DISPLAY="`echo "$TERM" | /bin/sed 's/[^@]*@[^@]*@\(.*\)/\1/'`"; export DISPLAY
WINDOWID="`echo "$TERM" | /bin/sed 's/[^@]*@\([^@]*\)@.*/\1/'`"; export WINDOWID
;;
esac
TERM="`echo "$TERM" | /bin/sed 's/@.*//'`"; export TERM
;;
@*)
case "${DISPLAY-}" in
'') DISPLAY="`echo "$TERM" | /bin/sed 's/@//'`"; export DISPLAY;;
esac
unset TERM
;;
*@*)
case "${DISPLAY-}" in
'') DISPLAY="`echo "$TERM" | /bin/sed 's/[^@]*@//'`"; export DISPLAY;;
esac
TERM="`echo "$TERM" | /bin/sed 's/@.*//'`"; export TERM
;;
esac
TERM="`/bin/tsetup`"; export TERM
case "${PATH-}" in \~/bin|*:\~/bin|\~/bin:*|*:\~/bin:*) :;; *)
PATH="${PATH%:.}:~/bin:."; export PATH
esac
CDPATH=".:~"; export CDPATH
LESS=-MM; export LESS
PGPPATH="${HOME%/}/.pgp"; export PGPPATH
tmp="${tmp:-/var/tmp/$$}"
#
# Set EMACS editing mode (only for ksh); We cannot use "set -o emacs" because
# /bin/sh would not like it, and if we would not export the EDITOR environment
# variable, line editing would stop after forking another ksh.
#
if [ -z "${EDITOR-}" ]; then
EDITOR=emacs
fi
case "${TERM-}" in
xterm*) PS1=']0;\u@\h:\w\$ ';;
*) PS1='\u@\h:\w \$ ';;
esac
case "${TERM-}" in
console|con80x25) MINICOM="-l -con -tminicom-$TERM"; export MINICOM;;
esac
e()
{
case $# in
0) echo "\$ ${VISUAL-${EDITOR-emacs}} ${efile-}"
${VISUAL-${EDITOR-emacs}} ${efile-};;
*) efile="$@"; ${VISUAL-${EDITOR-emacs}} "$@";;
esac
}
setenv()
{
case $# in
2) eval "$1=$2"; export "$1";;
*) echo "usage: setenv <EN_VAR> <Value>" >&2; return 1;;
esac
}
unsetenv()
{
unset ${@+"$@"}
}
rehash()
{
hash -r
}
limit()
{
echo 'Use ulimit to set process limits; type "help ulimit" for help.'>&2
return 1
}
unlimit()
{
echo 'Use ulimit to set process limits; type "help ulimit" for help.'>&2
return 1
}
trap 15