Environment vars calling programs

Don Harrop Don Harrop <don@nis4u.com>
Mon, 30 Oct 2000 11:47:04 -0700 (MST)


Damn, I hate syntax!  ;-)  That's what I get for playing with Linux boxes
that have always set stuff up like that for me..  I've got a couple other
questions that might be pretty easy too..  Basically what I want to do is
create a prompt that displays the username@hostname:pathname like you get
in most Linux installs.  With that last tid-bit I can set the prompt to
print everything I want until I su.  The username doesn't follow the user.  
I'm setting USER=`whoami` and using $USER in PS1 to get the username.  
I've also used `whoami` directly in the PS1 var.  No luck.  Is that
because the su program on HP-UX isn't designed to update any env vars?  
I'm setting all this up in the global config files so whoever I log in as
gets this setup but as soon as you su to anyone else it seems like it
looses the environment variable info.  Also when telneting in I have to
use ctrl H to backspace.  I've set ERASE='^H' and that doesn't seem to
help.  Do I have to use the escape code?  The environment is HP-UX 10.20
and I'm running a standard POSIX shell.

On Mon, 30 Oct 2000, Jeffrey Pyne wrote:

> Try using backticks instead of single quotes (i.e.
> HOSTNAME=`/bin/hostname`).  
> 
> -----Original Message-----
> From: Don Harrop [mailto:don@nis4u.com]
> Sent: Monday, October 30, 2000 10:28 AM
> To: plug-discuss@lists.PLUG.phoenix.az.us
> Subject: Environment vars calling programs
> 
> 
> Ok, here's the first HP-UX question.  I want to setup the HOSTNAME var to
> function like it does under Linux.  If I set HOSTNAME='/bin/hostname' and
> echo $HOSTNAME I get '/bin/hostname' printed back, not the hostname of the
> machine..  Any ideas?
> 
> Don
> 
> 
> ________________________________________________
> See http://PLUG.phoenix.az.us/navigator-mail.shtml if your mail doesn't post
> to the list quickly and you use Netscape to write mail.
> 
> Plug-discuss mailing list  -  Plug-discuss@lists.PLUG.phoenix.az.us
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
> 
> ________________________________________________
> See http://PLUG.phoenix.az.us/navigator-mail.shtml if your mail doesn't post to the list quickly and you use Netscape to write mail.
> 
> Plug-discuss mailing list  -  Plug-discuss@lists.PLUG.phoenix.az.us
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>