bug-bash
[Top][All Lists]
Advanced

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

Re: repeated parameter expansion and param. exp. on prompt variables


From: Paul Jarc
Subject: Re: repeated parameter expansion and param. exp. on prompt variables
Date: Sat, 14 Feb 2004 13:45:42 -0500
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux)

Ami Fischman <address@hidden> wrote:
>    Any ideas on how to substitute patterns in \w on the fly for each
>    prompt display?

ps1() {
  local pwd=$PWD
  pwd=${pwd/$HOME/~} # mimic \w
  pwd=${pwd/foo/bar} # and then some
  echo "$pwd"
}
PS1='$(ps1)'

>    SHORTVAR=${${MYVAR/SomeLongText/SLT}/SomeOtherLongText/SOLT}

SHORTVAR=${MYVAR/SomeLongText/SLT}
SHORTVAR=${SHORTVAR/SomeOtherLongText/SOLT}


paul




reply via email to

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