[Top][All Lists]

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

TZ=... date affected PROMPT_COMMAND

From: jidanni
Subject: TZ=... date affected PROMPT_COMMAND
Date: Wed, 16 Apr 2008 21:15:26 +0800

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 -c 'TZ=America/Chicago date'
if one doesn't want their prompt affected.

(On the other hand, what I do in .bashrc is black magic to me too:)
PROMPT_COMMAND='prompt_tricks_z=" $?"; prompt_tricks_z=${prompt_tricks_z# 0}
 case $PWD in $HOME) pwd=\~;; *) pwd=${PWD##*/};; esac' #cfaj.freeshell.org
PS1=$SPECIAL_PS1"$my_color_on\A\$prompt_tricks_z \$pwd\\$""$my_color_off "

reply via email to

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