bash_ps1_special_process

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



Subject: RE: Bash questions
From: "Steven W. Orr" <steveo@world.std.com>
Date: Wed, 22 Nov 2000 17:40:46 -0500 (EST)



On Wed, 22 Nov 2000, Bill Carlson wrote:

=>On Tue, 21 Nov 2000, Stan Isaacs wrote:
=>
=>> > The full comment in /etc/bashrc on my machine (RH6.0) is:
=>> >
=>> > # For some unknown reason bash refuses to inherit
=>> > # PS1 in some circumstances that I can't figure out.B
=>> > # Putting PS1 here ensures that it gets loaded every time.
=>> > PS1="[\u@\h \W]\\$ "
=>> >
=>> > Sounds pretty clear to me.
=>>
=>>     Thanks for quoting it for me.  That's exactly the question I'm asking:
=>> What is the "unknown reason"?  Has anybody figured out the circumstances?
=>> Then maybe I could decide if it's worth while to pull the setting out of
=>> /etc/bashrc.
=>>
=>
=>I don't have an older box handy, but IIRC that comment has been there for
=>quite a while, it might be an old bug in bash that whomever created the
=>comment worked around rather than figure out. One could try commenting it
=>out in /etc/bashrc and see what happens.
=>
=>Bill Carlson
=>


PS1 is a 'special' variable. If you export it it will not be inherited by
child processes. Just set it in your .bashrc and all will be well.

===

Subject: RE: Bash questions
From: "Steven W. Orr" <steveo@world.std.com>
Date: Wed, 22 Nov 2000 17:41:48 -0500 (EST)

Sorry, I forgot to tell you why PS1 will not export: You need to be able
to test it in shell scripts to see if you are in an interactive shell. If
it was exported, that mechanism would not work.

===



the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu