[BACK]Return to ksh.kshrc CVS log [TXT][DIR] Up to [local] / src / etc

Diff for /src/etc/ksh.kshrc between version 1.15 and 1.16

version 1.15, 2010/04/26 09:04:15 version 1.16, 2011/07/04 19:52:37
Line 92 
Line 92 
         esac          esac
         # do we want window decorations?          # do we want window decorations?
         if [ "$ILS" ]; then          if [ "$ILS" ]; then
                 ilabel () { print -n "${ILS}$*${ILE}">/dev/tty; }                  function ilabel { print -n "${ILS}$*${ILE}">/dev/tty; }
                 label () { print -n "${WLS}$*${WLE}">/dev/tty; }                  function label { print -n "${WLS}$*${WLE}">/dev/tty; }
   
                 alias stripe='label "$USER@$HOST ($tty) - $PWD"'                  alias stripe='label "$USER@$HOST ($tty) - $PWD"'
                 alias istripe='ilabel "$USER@$HOST ($tty)"'                  alias istripe='ilabel "$USER@$HOST ($tty)"'
   
                 wftp () { ilabel "ftp $*"; "ftp" "$@"; eval istripe; }                  function wftp { ilabel "ftp $*"; "ftp" "$@"; eval istripe; }
                 wcd () { \cd "$@" && eval stripe; }                  function wcd { \cd "$@" && eval stripe; }
                 wssh ()                  function wssh
                 {                  {
                         local rc                          local rc
                         "ssh" "$@"                          "ssh" "$@"
Line 109 
Line 109 
                         eval stripe                          eval stripe
                         return $rc                          return $rc
                 }                  }
                 wtelnet ()                  function wtelnet
                 {                  {
                         local rc                          local rc
                         "telnet" "$@"                          "telnet" "$@"
Line 118 
Line 118 
                         eval stripe                          eval stripe
                         return $rc                          return $rc
                 }                  }
                 wrlogin ()                  function wrlogin
                 {                  {
                         local rc                          local rc
                         "rlogin" "$@"                          "rlogin" "$@"
Line 127 
Line 127 
                         eval stripe                          eval stripe
                         return $rc                          return $rc
                 }                  }
                 wsu ()                  function wsu
                 {                  {
                         local rc                          local rc
                         "su" "$@"                          "su" "$@"
Line 173 
Line 173 
 # commands for both interactive and non-interactive shells  # commands for both interactive and non-interactive shells
   
 # is $1 missing from $2 (or PATH) ?  # is $1 missing from $2 (or PATH) ?
 no_path () {  function no_path {
   eval _v="\$${2:-PATH}"    eval _v="\$${2:-PATH}"
   case :$_v: in    case :$_v: in
   *:$1:*) return 1;;            # no we have it    *:$1:*) return 1;;            # no we have it
Line 181 
Line 181 
   return 0    return 0
 }  }
 # if $1 exists and is not in path, append it  # if $1 exists and is not in path, append it
 add_path () {  function add_path {
   [ -d ${1:-.} ] && no_path $* && eval ${2:-PATH}="\$${2:-PATH}:$1"    [ -d ${1:-.} ] && no_path $* && eval ${2:-PATH}="\$${2:-PATH}:$1"
 }  }
 # if $1 exists and is not in path, prepend it  # if $1 exists and is not in path, prepend it
 pre_path () {  function pre_path {
   [ -d ${1:-.} ] && no_path $* && eval ${2:-PATH}="$1:\$${2:-PATH}"    [ -d ${1:-.} ] && no_path $* && eval ${2:-PATH}="$1:\$${2:-PATH}"
 }  }
 # if $1 is in path, remove it  # if $1 is in path, remove it
 del_path () {  function del_path {
   no_path $* || eval ${2:-PATH}=`eval echo :'$'${2:-PATH}: |    no_path $* || eval ${2:-PATH}=`eval echo :'$'${2:-PATH}: |
     sed -e "s;:$1:;:;g" -e "s;^:;;" -e "s;:\$;;"`      sed -e "s;:$1:;:;g" -e "s;^:;;" -e "s;:\$;;"`
 }  }

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16