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

Re: [hobbit] Ext tests/scripts



On Tue, Feb 15, 2005 at 09:32:02AM +1100, Adam Goryachev wrote:
> On Mon, 2005-02-14 at 22:59 +0100, Henrik Stoerner wrote:
> > NB: The environment variables provided by Hobbit to a script is not 
> > quite the same as that which BB provides. Some BB extensions use
> > environment variables for some commands, e.g $GREP instead of grep.
> > Hobbit does not set this up by default, so you should check what 
> > your scripts expect, and if necessary add the extra environment
> > variables to hobbitserver.cfg (or change the script).
> 
> Just wondering if there is a reason for this?

Sure is.

Finding the commands to go with those environment variables is tricky,
since some implementations hide the useful ones in odd
places. E.g. have you ever tried getting the wrong "id" command on
Solaris ? The useful one is /usr/xpg4/bin/id, not /bin/id (which
doesn't know about all those options I take for granted because I'm
spoilt by GNU software).

Just an example ... don't get me started on /usr/ccs/bin or
/usr/ucb/bin or the horrors in /opt :-(

Since Hobbit doesn't use those commands *at all* - the only shell
scripts in Hobbit are the wrappers to set up environments for the CGI
scripts - it would be a lot of effort with no benefit to Hobbit.

And really, most of the BB extensions really are client-side scripts.
They'll run just fine as extensions to the BB client. Hobbit is a
server-side replacement (yes, I know there are thoughts and plans and
even some code for a Hobbit client, but that's some time into the
future), so the number of scripts that are bitten by this is fairly
small, I think.

> It would seem a shame to need to make all these scripts *more*
> specific...

Just add the needed ones to hobbitserver.cfg - it might be as simple
as 

  SED=sed
  GREP=grep
  AWK=awk
  CAT=cat
  TR=tr

to make them work and just use whatever is in the PATH.


Regards,
Henrik