This version works the same as the more verbose one:
PROMPT_COMMAND='prompt_status=\ $?'
PS1=$SPECIAL_PS1"$my_color_on\A\${prompt_status# 0} \W\$$my_color_off "
Putting the variables inside $(...) avoids global variables and use of
PROMPT_COMMAND:
PS1='\A$(S=$?; W=$((S>99?4:(S>9?3:(S>0?2:0;
[EMAIL PROTECTED] wrote:
Never thought that putting TZ here would infect my prompt,
21:07 ~$ date
Wed Apr 16 21:07:54 CST 2008
21:07 ~$ TZ=America/Chicago date
Wed Apr 16 08:08:07 CDT 2008
08:08 ~$ set a b c
08:08 ~$ date
Wed Apr 16 21:08:22 CST 2008
21:08 ~$
all the way until the next non buil
Never thought that putting TZ here would infect my prompt,
21:07 ~$ date
Wed Apr 16 21:07:54 CST 2008
21:07 ~$ TZ=America/Chicago date
Wed Apr 16 08:08:07 CDT 2008
08:08 ~$ set a b c
08:08 ~$ date
Wed Apr 16 21:08:22 CST 2008
21:08 ~$
all the way until the next non built-in command.
Need to do sh