Subject: Re: Root .profile
To: Gandhi woulda smacked you <greywolf@starwolf.com>
From: Brian D Chase <bdc@world.std.com>
List: current-users
Date: 04/12/1999 09:26:28
On Sun, 11 Apr 1999, Gandhi woulda smacked you wrote:

> Why not:
> 
> PS1="${HOST:=`/bin/hostname -s`}${PS1} "

I'd thought about it doing it that way, but was worried about the
following behavior (though I didn't follow my worries all the way
through):

(Initial PS1 == "# ")

PS1="${HOST:=`/bin/hostname -s`}${PS1} "

(Modified PS1 == "hostname# ")

PS1="${HOST:=`/bin/hostname -s`}${PS1} "

(Twice modified PS1 == "hostnamehostname# ")

...

I gather in /etc/profile or $HOME/.profile it would be okay.  Greg Woods
pointed out that the ever-growing prompt would only be a problem if one
were to deliberately source the profile multiple times.

Sorry about all the bandwidth I've spent on /etc/profile.

-brian.
---
Brian "JARAI" Chase | http://world.std.com/~bdc/ | VAXZilla LIVES!!!