[LUNI] Customize the PS1 prompt

Martin Maney maney at pobox.com
Fri Jun 6 12:07:03 CDT 2003


On Thu, Jun 05, 2003 at 06:57:01PM -0500, Mike Crawford wrote:
> Doing something like PS1='`pwd`\\$' will have pwd evaluated each time,
> but that, as I said, screws up $?, it will always report 0, or at least
> it did that when I created my uber prompt.

Interesting.  With the simple ...\`pwd\`.. prompt setting, that doesn't
seem to be the case here:

maney at windhover /home/maney $ true
maney at windhover /home/maney $ echo $?
0
maney at windhover /home/maney $ false
maney at windhover /home/maney $ echo $?
1
maney at windhover /home/maney $ bash --version
GNU bash, version 2.05a.0(1)-release (i386-pc-linux-gnu)

It makes perfect sense for bash not to forget the "real" last-run
process's result just because it runs a throwaway process in the
prompt.  "You remember what you want to remember, and you forget what
you want to forget.  You dig?"

-- 
The vulnerabilities will come, a couple of them a week, for years and
years...until people stop looking for them.  Waiting six months isn't
going to make this OS [Windows XP] safer.  -- Bruce Schneier



More information about the luni mailing list