&#%@§!! environment

Jeffrey M. Vinocur jeff at litech.org
Mon Feb 19 05:00:42 UTC 2001


On Mon, 19 Feb 2001, Zenon Panoussis wrote:

> WHOAMI          = (whoami || /usr/ucb/whoami || $(PERLWHOAMI)) 2> /dev/null
>
> This is way above my head, but one thing is for sure: there no
> /usr/ucb directory on my machine, and whoami is certainly not
> in it.

Those || things are "or" -- it tries them in order until one succeeds.
That is, first it tries to run `whoami`, which will probably work just
fine, but if it can't find it, it tries an explicit path.  That shouldn't
be a problem.

About your "Command not found" thing -- there is an interesting subtly
that sometimes really confuses people when scripts are involved.  The
first line of a script has a #! line that says where to find the
interpreter.  If that program can't be found, the error message looks just
like the script itself wasn't found.  (While in fact, the script was
found, but the program specified to run it was not.)  For example:

> ls -l example
-rwxrwxr-x    1 jeff     jeff           31 Feb 18 23:57 example*

> cat example
#!/bin/NotAnInterpreter

blah

> ./example
./example: Command not found.


I can't imagine this is your problem (it usually only shows up with Perl
scripts, since sometimes it's /usr/bin/perl and sometimes
/usr/local/bin/perl), but you might check for the program specified on the
first line just in case.


-- 
Jeffrey M. Vinocur
jeff at litech.org



More information about the inn-workers mailing list