* $? sh -c "type '$PROG'"
Btw, you don't need the leading $ in your line, and then you'd leave
off the hard quotes around $PROG. You'd have: * ? sh -c "type $PROG"
Sorry, no good. The shell might see the command
>type /some/ path/aw withspacesk<
and you're lucky if it only doesn't work.
You're right though that it's safest to let the shell expand PROG, for
that the shell needs to see >type "$PROG"<
ie the $PROG must be in dquotes. Therefore
* ? test -c 'type "$PROG"'
should do it. I'm never sure whether sh -c takes only one or any number
of arguments, but it might well depend on the sh in use. If the squotes
were left out, woud the shell still see the dquotes or would they be
removed by procmail?
As for efficiency, the general rule was that procmail calls programs
directly if no special shell stuff is involved, so I try to make use of
it when possible. With "test" it's not, at least as long as I don't want
to use full paths. I don't want to use full paths because not to is more
portable and less fuss. That's what PATH is for.
As for whether it's worth your time, well, you must have some doubts and
guilty feelings, or you wouldn't be asking in order to waste ours. ;-)
The annoying thing is that something as simple as this shouldn't take up
that much time, whether it's mine or someone else's time==money. From
that point of view, most languages are poorly designed.
personal thing you're highly proud of, :-) then it might not be worth
the time to futz around and make it perfect.
:-)) Yeah I know I'm too much of an idiot^H^H^H^Hgeek and always look
for the perfect solution... until the pressures of the day take upper
hand.
Are you giving the right path so the test can find awk?
"test" will *never* find anything unless you specify a direct path to
it. Test it in your shell. The "test" of the GNU coreutils doesn't and
the (excellent) man page implies so. That's enough of a k.o. to make
this method useless. Things have to work everywhere, all the time. Ok,
ideally.
Volker
--
Volker Kuhlmann is possibly list0570 with the domain in header
http://volker.dnsalias.net/ Please do not CC list postings to me.
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail