Hello list,

maybe this can be done better (~/.kshrc):

_pwd(){

  local _len="25"

  local _sym="/<.."

  [[ ${PWD} == ${HOME}* ]] && { PWD="~${PWD#${HOME}}"; _sym="~${_sym#/}"; }

  [[ ${#PWD} -gt $_len ]] && { typeset -R"$_len" local _pwd=$PWD; 
PWD="${_sym}/${_pwd#*/}"; }

  print $PWD
}

PS1='\h:$(_pwd)\\$ '

Any hints?

Thanks in advance.

-- 

Reply via email to