procmail
[Top] [All Lists]

Re: Weird problem with shell execution

2008-03-22 14:20:28
On Tue, Mar 18, 2008 at 12:10 PM, Michelle Konzack
<linux4michelle(_at_)freenet(_dot_)de> wrote:
  LENGHT=`echo ${#NUMBER}`

I suspect that procmail is trying to substitute its own value for $#
(number of command line arguments) before it even gets as far as
calling the shell to do the echo.  ${#NUMBER} as a way of returning
the number of characters in $NUMBER is a more recent shell invention
than procmail's 20+ years old parser is prepared to deal with.

You might be able to work around that by doing this:

LENGTH=`echo ${#NUMBER} ; :`

The semicolon will tell procmail that it can't execute the command
directly and must instead spawn a shell, which may bypass its attempt
to do the variable substitution internally.

If that doesn't work, you'll have to do something like

:0
* 1^1 NUMBER ?? .
{ LENGTH=$= }

(I fixed the HT -> TH in both examples above, in case you didn't notice.)
____________________________________________________________
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

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