On 08/04/16 00:25, Fred wrote:
On 08/03/16 23:19, Uwe Werler wrote:
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.


are you looking for \w?

as in:

PS1="\h:\u \w> "

hth

Fred

\w won't help shorten the $PWD

Sorry for the noise...

Reply via email to