[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: $HOSTNAME is not exported



On Tue, 16 Dec 2003, Sergey Spiridonov wrote:

> I found out, that $HOSTNAME is not exported by default in latest unstable:
>
> ss@mars:~$ echo $HOSTNAME
> mars
> ss@mars:~$ env | grep HOSTNAME
> ss@mars:~$
>
> Is it a bug?

It might be a change in behavior, but I woudn't call it a bug. $HOSTNAME
seems to be a bash-specific variable. I use zsh, and I used to use tcsh,
and neither of them have it (zsh has a similar $HOST, though). I don't
think $HOSTNAME is considered a "standard" environment variable.

You could export $HOSTNAME manually from something like .profile, I
suppose. You might also just use /bin/hostname, or /bin/uname -n.

- Aaron

-- 
Aaron Hall           :        If you can't get something right, then the
ahall@vitaphone.net  :        objective should be to do everything wrong
                     :        that it is possible to do wrong.



Reply to: