=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/etc/ksh.kshrc,v retrieving revision 1.15 retrieving revision 1.16 diff -c -r1.15 -r1.16 *** src/etc/ksh.kshrc 2010/04/26 09:04:15 1.15 --- src/etc/ksh.kshrc 2011/07/04 19:52:37 1.16 *************** *** 1,5 **** : ! # $OpenBSD: ksh.kshrc,v 1.15 2010/04/26 09:04:15 otto Exp $ # # NAME: # ksh.kshrc - global initialization for ksh --- 1,5 ---- : ! # $OpenBSD: ksh.kshrc,v 1.16 2011/07/04 19:52:37 halex Exp $ # # NAME: # ksh.kshrc - global initialization for ksh *************** *** 92,106 **** esac # do we want window decorations? if [ "$ILS" ]; then ! ilabel () { print -n "${ILS}$*${ILE}">/dev/tty; } ! label () { print -n "${WLS}$*${WLE}">/dev/tty; } alias stripe='label "$USER@$HOST ($tty) - $PWD"' alias istripe='ilabel "$USER@$HOST ($tty)"' ! wftp () { ilabel "ftp $*"; "ftp" "$@"; eval istripe; } ! wcd () { \cd "$@" && eval stripe; } ! wssh () { local rc "ssh" "$@" --- 92,106 ---- esac # do we want window decorations? if [ "$ILS" ]; then ! function ilabel { print -n "${ILS}$*${ILE}">/dev/tty; } ! function label { print -n "${WLS}$*${WLE}">/dev/tty; } alias stripe='label "$USER@$HOST ($tty) - $PWD"' alias istripe='ilabel "$USER@$HOST ($tty)"' ! function wftp { ilabel "ftp $*"; "ftp" "$@"; eval istripe; } ! function wcd { \cd "$@" && eval stripe; } ! function wssh { local rc "ssh" "$@" *************** *** 109,115 **** eval stripe return $rc } ! wtelnet () { local rc "telnet" "$@" --- 109,115 ---- eval stripe return $rc } ! function wtelnet { local rc "telnet" "$@" *************** *** 118,124 **** eval stripe return $rc } ! wrlogin () { local rc "rlogin" "$@" --- 118,124 ---- eval stripe return $rc } ! function wrlogin { local rc "rlogin" "$@" *************** *** 127,133 **** eval stripe return $rc } ! wsu () { local rc "su" "$@" --- 127,133 ---- eval stripe return $rc } ! function wsu { local rc "su" "$@" *************** *** 173,179 **** # commands for both interactive and non-interactive shells # is $1 missing from $2 (or PATH) ? ! no_path () { eval _v="\$${2:-PATH}" case :$_v: in *:$1:*) return 1;; # no we have it --- 173,179 ---- # commands for both interactive and non-interactive shells # is $1 missing from $2 (or PATH) ? ! function no_path { eval _v="\$${2:-PATH}" case :$_v: in *:$1:*) return 1;; # no we have it *************** *** 181,195 **** return 0 } # if $1 exists and is not in path, append it ! add_path () { [ -d ${1:-.} ] && no_path $* && eval ${2:-PATH}="\$${2:-PATH}:$1" } # if $1 exists and is not in path, prepend it ! pre_path () { [ -d ${1:-.} ] && no_path $* && eval ${2:-PATH}="$1:\$${2:-PATH}" } # if $1 is in path, remove it ! del_path () { no_path $* || eval ${2:-PATH}=`eval echo :'$'${2:-PATH}: | sed -e "s;:$1:;:;g" -e "s;^:;;" -e "s;:\$;;"` } --- 181,195 ---- return 0 } # if $1 exists and is not in path, append it ! function add_path { [ -d ${1:-.} ] && no_path $* && eval ${2:-PATH}="\$${2:-PATH}:$1" } # if $1 exists and is not in path, prepend it ! function pre_path { [ -d ${1:-.} ] && no_path $* && eval ${2:-PATH}="$1:\$${2:-PATH}" } # if $1 is in path, remove it ! function del_path { no_path $* || eval ${2:-PATH}=`eval echo :'$'${2:-PATH}: | sed -e "s;:$1:;:;g" -e "s;^:;;" -e "s;:\$;;"` }