Paul Jarc wrote:
Matthew Woehlke <mw_tr...@users.sourceforge.net> wrote:
Actually, a feature that would be REALLY helpful is a way to specify
certain directory strings that should be abbreviated.

PS1='...$(mypath)...'
mypath() {
  case $PWD/ in
    /usr/local/src/kde/svn/trunk/*)
      printf %s "${PWD/#\/usr\/local\/src\/kde\/svn\/trunk/\$src\$}";;
    /usr/local/build/kde/svn/trunk/*)
      printf %s "${PWD/#\/usr\/local\/build\/kde\/svn\/trunk/\$build\$}";;
    *) printf %s "$PWD";;
  esac
}

Yike. Okay, but if that's possible, what's the point of PROMPT_DIRTRIM? :-)

Anyway, I like this better:
PS1="...\$(mypath  \"\w\")..."

:-)

--
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
--
"Doggy!" -- Robots from Freefall (http://freefall.purrsia.com)



Reply via email to