[Top][All Lists]

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

Re: truncating the path in the bash prompt?

From: Matthew Woehlke
Subject: Re: truncating the path in the bash prompt?
Date: Thu, 15 Jan 2009 16:49:59 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20090105 Fedora/ Thunderbird/ Mnenhy/

Paul Jarc wrote:
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.

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

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

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


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

reply via email to

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