hostname vs. HOSTNAME ?
What is the difference between issuing a hostname command, e.g.,
hostname mybox, and changing the environment variable HOSTNAME=mybox ? Thank you. |
As far as I know the hostname command changes/reports the hostname but it will not survive a reboot - it will revert back to localhost.localdomain
The HOSTNAME variable SETS the hostname as the box boots. Think thats right. On redhat/fedroa the file is /etc/sysconfig/network Try it! |
After experimenting, here is my GUESS:
"hostname" changes the hostname immediately, whereas "export HOSTNAME=newname" changes the env variable and would become effective on the next reboot (or login??) If either method is used it does not affect the other. I have not tested to see what happens on reboot.... |
All times are GMT -5. The time now is 03:35 PM. |