<div dir="ltr"><div><div><div><br><br><br>On 12 August 2014 08:16, Giles Orr <<a href="mailto:gilesorr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org">gilesorr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a>> wrote:<br>> On 12 August 2014 02:41, William Park <<a href="mailto:opengeometry-FFYn/CNdgSA@public.gmane.org">opengeometry-FFYn/CNdgSA@public.gmane.org</a>> wrote:<br>
> > On Mon, Aug 11, 2014 at 09:17:28PM -0400, Giles Orr wrote:<br>> > > I'm using openbox on an Acer Chromebook (full install, not crouton).  I'm<br>> > > pretty pleased with the hardware, but I've got a problem with Openbox's<br>
> > > autostart file.  It's a shell script, so I should be able to make decisions<br>> > > about what to run based on the hostname.  This matters because I share<br>> > > configuration files and dotfiles across multiple hosts.  But it doesn't<br>
> > > work.  I've tried:<br>> > ><br>> > > if [ "$(hostname)" == "crom" ] # works at the command line<br>> > > then<br>> > >     xterm -fn terminus-18 &<br>
> > > fi<br>> > ><br>> > > if [ "${HOSTNAME}" == "crom" ] # ditto<br>> > > ...<br>> > ><br>> > > if [ "$(cat /etc/hostname)" == "crom" ] # ditto<br>
> > > ...<br>> > ><br>> > > None work in ~/.config/openbox/autostart .  I dumped $(env) to a file from<br>> > > within the autostart and HOSTNAME isn't set, so that explains the middle<br>
> > > one failing, but I have no explanation for why the others don't work.  Can<br>> > > anyone help?<br>> ><br>> > Try single '=', or use Bash/Ksh which support '=='.<br>
><br>> Thanks Walter - I do have the file.<br>><br>> William - that's a very good point: I was automatically assuming Bash because it's what I use all the time, and that may well NOT be what's used by Openbox.  It obviously uses a shell of some sort, but which one is open to question.  I will confirm later.  Thanks!<br>
<br></div>Extra thanks to William, who did indeed spot the problem: I was using a bash construct while openbox was using some more stripped down sh.  Changing the line to <br><br></div>if [ "$(cat /etc/hostname)" = "crom" ]<br>
<br></div>(ie. with "=" instead of "==") has fixed the problem.<br><div><div><div><br>--<br>Giles<br><a href="http://www.gilesorr.com/">http://www.gilesorr.com/</a><br><a href="mailto:gilesorr@gmail.com">gilesorr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org</a></div>
</div></div></div>