bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: truncating the path in the bash prompt?


From: Paul Jarc
Subject: Re: truncating the path in the bash prompt?
Date: Wed, 14 Jan 2009 12:46:26 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Matthew Woehlke <address@hidden> 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
}


paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]