procmail
[Top] [All Lists]

variable=`command` vs. variable=|command

1998-01-22 16:36:28
Grumble grumble grumble.

I had this recipe, which had worked flawlessly for over three years:

   :0Dbir # these messages have very short bodies, often empty ones
   * variable ?? [A-Z]
   variable=| echo $variable | tr A-Z a-z

Now this week it is clobbering the value of $variable and giving back null.
The result is the same on both the SysV and the BSD platforms here, and
testing it with another command that has no characters from $SHELLMETAS
has the same poor results, so invoking a shell is not the problem.

The version of tr there does not require bradkets, so that is not the
problem.

And I swear on a stack of manuals that it worked properly all this time,
but in my testing today it consistently fails!

This works, and I'm using it for now:

  :0D
  * variable ?? [A-Z]
  { variable=`echo $variable | tr A-Z a-z` }

If someone knows a good reason that the first syntax clobbers the previous
value of the variable on the way in but the second allows it to be used in
the command, please share.  The whole thing looks six-legged to me.

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