ksh startup files
Tonight I spent some time to clean up my ksh setup. I had a huge .profile, which was just a copy of /etc/ksh.kshrc. No good. Now I have the stock .profile (that comes for new users in OpenBSD) with this line added:
export ENV=$HOME/.kshrc
and then I have put in a shiny new ~/.kshrc with something like this in it:
if [ -o interactive ]; then
. /etc/ksh.kshrc
fi
spwd () {
( IFS=/
set $PWD
if test $# -le 3 ; then
echo "$PWD"
else
eval echo \"..\${$(($#-1))}/\${$#}\"
fi ) ; }
HOST=`hostname| cut -d. -f1`
# PS1='${HOST} ${PWD##$HOME?(/)}$ '
PS1='${HOST} $(spwd)$ '
export EXINIT='set ai sw=4'
if [ -o interactive ]; then
echo coming up:
/usr/bin/calendar -A 14
fi
This keeps my prompt pretty short (it displays only the last 2 directories) and gives me otherwise and nice, clear prompt. I played around with using vi key bindings for shell line editing again, but again moved back.
It also displays my calendar contents for the next 14 days. Neato. Read man calendar for how to feed that calendar!
On a related side note, in OS X you can now remap the Caps Lock key to act as a Control key without any hax0ring around: Can be changed from the System Preferences -> Keyboard & Mouse -> Keyboard -> Modifier Keys. Nice.
