dc1902
#
dc1902
# /etc/kshrc is sourced in interactive shells.  It
dc1902
# should contain commands to set up aliases, functions,
dc1902
# options, key bindings, etc.
dc1902
#
dc1902
dc1902
# Set prompts
dc1902
#PROMPT='[%n@%m]%~%# '    # default prompt
dc1902
#RPROMPT=' %~'     # prompt for right side of screen
dc1902
dc1902
_src_etc_profile_d()
dc1902
{
dc1902
    # from zshrc, with ksh fixes
dc1902
    if [[ ! -o login ]]; then # We're not a login shell
dc1902
        for i in /etc/profile.d/*.sh; do
dc1902
	    if [ -r "$i" ]; then
dc1902
	        . $i
dc1902
	    fi
dc1902
        done
dc1902
        unset i
dc1902
    fi
dc1902
}
dc1902
dc1902
pathmunge () {
dc1902
case ":${PATH}:" in
dc1902
*:"$1":*)
dc1902
    ;;
dc1902
*)
dc1902
    if [ "$2" = "after" ]; then
dc1902
        PATH=$PATH:$1
dc1902
    else
dc1902
        PATH=$1:$PATH
dc1902
    fi
dc1902
esac
dc1902
}
dc1902
dc1902
_src_etc_profile_d
dc1902
dc1902
unset -f _src_etc_profile_d
dc1902
unset -f pathmunge
dc1902
dc1902
# key bindings - make Delete, Home, End,... work
dc1902
keybd_trap () {
dc1902
  case ${.sh.edchar} in
dc1902
    $'\e[1~') .sh.edchar=$'\001';; # Home = beginning-of-line
dc1902
    $'\e[F')  .sh.edchar=$'\005';; # End = end-of-line
dc1902
    $'\e[5~') .sh.edchar=$'\e>';; # PgUp = history-previous
dc1902
    $'\e[6~') .sh.edchar=$'\e<';; # PgDn = history-next
dc1902
    $'\e[3~') .sh.edchar=$'\004';; # Delete = delete-char
dc1902
  esac
dc1902
}
dc1902
trap keybd_trap KEYBD
dc1902