No, it doesn't work because ">" is in $SHELLMETAS, so procmail forks a shell,
and that shell has its own idea of what $1, $2, $*, and $@ are. "$@" works
properly only if procmail runs the program itself.
Try this:
:0bi
* $ !${1+!}
ARGS=| echo "$@"
:0Abi:/tmp/result.lock
| echo "$ARGS" > /tmp/result
It's not exactly the same but it's close. (I used `b' rather than `h'
because I take it that you're working with test messages where the bodies
tend to be shorter than the heads.)
Or try this:
REALLOGFILE=$LOGFILE
LOGFILE=/tmp/result
LOG="`echo "$@"
`
LOGFILE=$REALLOGFILE
These both assume that there is a /bin/echo executable on your system (or an
executable named echo somewhere in $PATH), even if it is just a script that
passes its parameters to some shell's built-in echo.
Well that makes sense I guess. But I have tryed both of your code
samples and they don't work either.
How about this code:
:0
| /usr/bin/touch "$@"
I have no meta chars now but it still doesn't work.
---
Tony Jago, System Administrator, E-Mail:
T(_dot_)Jago(_at_)fit(_dot_)qut(_dot_)edu(_dot_)au
Faculty of Information Technology, Web: http://www.fit.qut.edu.au/staff/~tony
Queensland University of Technology.
Box 2434, Brisbane 4001, AUSTRALIA. "We need more horsepower!"
Phone: +61 7 3864-2573 Fax: +61 7 3864-1959