Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!rex!ukma!cwjcc!cwns1!chet From: chet@cwns1.CWRU.EDU (Chet Ramey) Newsgroups: gnu.bash.bug Subject: Re: PS1 and PROMPT_COMMAND pecularity Message-ID: <916@cwjcc.CWRU.Edu> Date: 27 Nov 89 22:26:27 GMT References: <8911141359.AA02584@tele.nokia.fi> Sender: news@cwjcc.CWRU.Edu Reply-To: chet@po.CWRU.Edu (Chet Ramey) Distribution: gnu Organization: Case Western Reserve Univ. Cleveland, Ohio, (USA) Lines: 28 In article <8911141359.AA02584@tele.nokia.fi> jnp@tele.nokia.fi writes: declare -x HOST=`hostname` set_prompt() { PWD=`pwd`; PS1="$HOST:`echo $PWD | sed -e s%$HOME%~%` (\#) "; export PS1; } declare -x PROMPT_COMMAND=set_prompt With version 1.03 I get the prompt correct immediately. But (spoiler) when cd'ing, pushd'ing, popd'ing I get the value of one of two shell variables. If I go to a sub-directory I get (on screen) the value of one variable. On dc'ing back (or popd'ing) I get the value of another - and I can do nothing but hit return (example): tnds01:~ (24) cd /usr/local/src/patch SHLVL=2 tnds01:/usr/local/src/patch (25) cd .. tnds01:/usr/local/src (26) cd ~/src/c tnds01:~/src/c (27) cd ~/ PAGER=/usr/local/bin/less tnds01:~ (28) I have sent a fix for this to Brian. Chet Ramey -- Chet Ramey Network Services Group "Where's my froggie?" Case Western Reserve University chet@ins.CWRU.Edu