-
Notifications
You must be signed in to change notification settings - Fork 1
/
.shlogin
57 lines (50 loc) · 1.58 KB
/
.shlogin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#
# .shlogin - login shell startup for plain Bourne Shell, sourced by ~/.profile
#
# N.B.: this is very similar to ~/.ashlogin!
#
#ident "@(#)HOME:.shlogin 37.6 24/10/16 17:01:42 (woods)"
# Note I allow for /etc/profile to be explicitly sourced by non-interactive,
# non-login shells, e.g. in ~/.xinitrc and from remote invocations of
# onx11server (defined in ~/.shrc), so here we're testing to see if a shell is
# truly a login shell or an interactive shell so we can determine what
# additional setup we want for such shells, such as setting $ENV and exporting
# it.
# ~/.shrc, source early by ~/.profile, which sources this file, did the tests
# for interactive/login shells
#
if ${sh_is_login}; then
#
# Commands for login shells
#
echo "$0: setup for Bourne Shell"
fi
if ${sh_is_interactive} || ${sh_is_login}; then
#
# Commands for interactive shells.
#
# for emacs timeclock.el
#
if [ ! -f ${HOME}/.timelog ] ; then
touch ${HOME}/.timelog
fi
if [ "${LOGNAME}" = root ] ; then
PS1="[${TTYN}]<${LOGNAME}@${UUNAME}> # "
else
PS1="[${TTYN}]<${LOGNAME}@${UUNAME}> $ "
fi
ENVFILE=${HOME}/.shrc; export ENVFILE
fi
# this may not do anything for sub-shells but let you type '. $ENV'
#
# (POSIX(2008) says ENV is only to be read by interactive shells, while more
# modern NetBSD and some other systems will read it for all shells (unless in
# "posix" mode), but most older shells ignore $ENV entirely)
#
if [ -n "${ENVFILE}" -a -r "${ENVFILE}" ] ; then
ENV=${ENVFILE}; export ENV
fi
if [ -z "$LOGNAME" ] ; then
# some systems won't allow this...
LOGNAME=${USER} ; export LOGNAME
fi