|
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 <usenet@fischman.org> 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
[Prev in Thread] | Current Thread | [Next in Thread] |