making vars in bash script accessible from shell

Price, Erik eprice at ptc.com
Fri Nov 8 12:02:05 EST 2002


> -----Original Message-----
> From: Derek Martin [mailto:gnhlug at sophic.org]
> Sent: Friday, November 08, 2002 11:21 AM
> To: GNHLUG mailing list
> Subject: Re: making vars in bash script accessible from shell
> 
> 
> Well, there's Pine for Windows...  ;-)

I'm thinking about trying Mozilla's mail client -- anyone have any
experience with it?  Any good?  (I'm not sure if I can get it to
access the Exchains mail server... I'll have to research it.)

> > Where I'm running into trouble is getting this value to
> > be echoed in my prompt, which is set in my .bashrc to this:
> > 
> > PS1="[\u@\h:${newPWD}]\$ "
> 
> You need to get $newPWD expanded at prompt time.
> 
> temp="\$newPWD"
> PS1="[\u@\h:$temp]\$ "
> 
> Voila!
> 
> Though I personally prefer a newline before the \$.  That way, my
> prompt doesn't interfere (much) with long commands...


AHHHH!!!!  That did it.  At the end of my "fixedprompt.sh" shell
script I added the temporary variable and assigned as its value
the escaped $newPWD (as you directed) and it works beautifully!

Thanks Derek and everyone else too.  Made my day.


Erik



More information about the gnhlug-discuss mailing list