[Gllug] $HOSTNAME
Lesley
lesleyb at herlug.org.uk
Fri Sep 11 05:57:06 UTC 2009
On Thu, Sep 10, 2009 at 09:58:22PM +0100, Tethys wrote:
> --------
>
> Carles Pina i Estany writes:
>
> >> Where is the $HOSTNAME variable set in OpenSUSE 10.1, using KDE3?
> >> Surely it's set from etc/HOSTNAME? Except they're suddenly different.
> >
> >cd /etc/
> >grep -r "$HOSTNAME" .
> >
> >should tell you the place...
>
> No, that would only tell you where it's dereferenced, not where
> it's set. You'd want to grep for "hostname" to find where it's set.
>
As I posted on Wednesday ....
grep -r HOSTNAME /etc/*
gives rise to ....
/etc/init.d/hostname.sh: [ -f /etc/hostname ] && HOSTNAME="$(cat /etc/hostname)"
/etc/init.d/hostname.sh: [ -z "$HOSTNAME" ] && HOSTNAME="$(hostname)"
/etc/init.d/hostname.sh: [ -z "$HOSTNAME" ] && HOSTNAME=localhost
/etc/init.d/hostname.sh: [ "$VERBOSE" != no ] && log_action_begin_msg "Setting hostname to '$HOSTNAME'"
on Debian stable.
If you grep -ir instead you'll automagically find both HOSTNAME and hostname as well as any case variation between.
Regards
L.
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list