Openbox autostart - detecting hostname

Walter Dnes waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org
Tue Aug 12 02:04:06 UTC 2014


On Mon, Aug 11, 2014 at 09:17:28PM -0400, Giles Orr wrote

> if [ "$(hostname)" == "crom" ] # works at the command line
> then
>     xterm -fn terminus-18 &
> fi
> 
> if [ "${HOSTNAME}" == "crom" ] # ditto
> ...
> 
> if [ "$(cat /etc/hostname)" == "crom" ] # ditto
> ...
> 
> None work in ~/.config/openbox/autostart .  I dumped $(env) to a file from
> within the autostart and HOSTNAME isn't set, so that explains the middle
> one failing, but I have no explanation for why the others don't work.  Can
> anyone help?

  Do you have a /etc/hostname file in the first place?  I don't, under
Gentoo.  As a matter of fact...

[d531][waltdnes][~] cat /etc/hostname
cat: /etc/hostname: No such file or directory

[d531][waltdnes][~] cat /etc/conf.d/hostname 
# Set to the hostname of this machine
hostname="d531"

-- 
Walter Dnes <waltdnes-SLHPyeZ9y/tg9hUCZPvPmw at public.gmane.org>
I don't run "desktop environments"; I run useful applications
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list