procmail
[Top] [All Lists]

Re: multiple 'test -x '

1997-06-06 12:56:00
Timothy Luoma asked,

| when the do the following, I get:
| 
| "test: too many arguments"
| 
| It works in /bin/sh just fine....

| * ! ? test -x $APPNMAIL -o -x $FORMAIL -o -x $GREP

If the make process found a /bin/test executable when you were compiling
procmail, procmail made a note internally that /bin/test existed.  So, since
there are no characters from $SHELLMETAS on the line, procmail is running
/bin/test rather than sh's built-in "test".  Perhaps your system's /bin/test
won't accept -o or -a but has some other way (like "||" and "&&") of ORing
and ANDing, whereas the built-in test of /bin/sh does accept them.

If the make process could not find a /bin/test executable, then procmail com-
piled with an internal note that the word "test" should be treated like a
character in $SHELLMETAS and should trigger a shell.

See if it works from /bin/sh if, instead of the naked word test, you try
        /bin/test -x thing1 -o -x thing2 -o -x thing3

As Philip suggested, you can force a shell by adding a trailing semicolon.
Another way is to use the [ ... ] syntax of test, because "[" is in
$SHELLMETAS.

[As both Philip and Andy have noted, your logic seems inside out, because
 the rest of your code indicates that you want to see whether all three are
 executable (in contrast to the case where at least one is not), not whether
 any of the three is (as opposed to the case where all three are not).]

<Prev in Thread] Current Thread [Next in Thread>