HOSTNAME: environment variable or not?

Peter L. Peres plp-ysDPMY98cNQDDBjDh4tngg at public.gmane.org
Fri Feb 18 18:12:32 UTC 2005



On Fri, 18 Feb 2005, bob wrote:

> On my Redhat system HOSTNAME is an exported environment variable.  ie.
>
> 	echo $HOSTNAME
>
> returns with a value.
>
> On a Debian system I've been working with HOSTNAME is not an exported
> environment variable.   ie.
>
> 	export | less
>
> doesn't show it.   Nor does the C function getenv("HOSTNAME") pick it up.
> Interestingly
>
> 	echo $HOSTNAME
>
> does?
>
> I'm confused.    Can someone enlighten me as to this bash nuance.

hostname is a user command, not a shell variable. cat 
/proc/sys/kernel/hostname should yield the same result.

Peter
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list