Hostname changes and the shell prompt...

Ben Beeson beesond001 at hawaii.rr.com
Thu Oct 5 00:20:32 PDT 2000


Aloha all,

	I am running RH 6.0 with kernel 2.2.14-5.0.14c on a machine
connected to a cable modem with Road Runner.  I have noticed that once in a
while my IP address gets renumbered.  That's OK, because Road Runner uses dhcp
and that's what it does.  My shell prompt is:
  
PS1="[\u@\h \W]\\$ "   

So what I get is a shell prompt that looks like this:

[ben at a24b165n42client129 ben]$   

The only problem is that the hostname part of the prompt doesn't match
the current IP address. It matches the IP address that was obtained when the
machine was booted.  In other words, if I get renumbered, my prompt doesn't
change.

	I would like to know if anyone knows how to fix this so that the prompt
variable updates and displays the correct IP address in the hostname portion of
the prompt.  If I can't do that, how can I assign a local hostname to the box
that doesn't get nuked when I get an IP address from the dhcp server?  

Thanks in advance,

Ben Beeson         
                                                



More information about the LUAU mailing list