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