I posted a similar question a few days ago, but got only one reply
suggesting to use another shell. Maybe my question was too obscure ?
Let's retry it :
I have rules in which I build incrementally an environment
variable. Then, if the variable is non-empty,
I want to use its value as a parameter to an external program,
and get the result back. Here is an excerpt of my rules :
---------------------------------
FOUND=""
:0 c:
* (^TO|^From.*)johnny
johnny
:0A
{ FOUND="$FOUND johnny" }
:0
* ! FOUND ?? \<\>
|echo $FOUND >> found.list
---------------------------------
Questions :
1) the test `! FOUND ?? \<\>' does not seem to work ; what I want
to do is to test whether $FOUND is different to "" ; how should
I do it ?
2) the echo command seems to work, provided the condition is true ;
now, suppose I want to call `myprogram' with parameter $FOUND,
and get the result back in RESULT, how do I do it ?
Please apologize for these probably trivial questions, but I am only
vaguely familiar with shells ; I have read the procmail man pages,
but I didn't find examples where an environment variable is checked
for its emptyness. I need to have a procmail solution for my
mail-filtering (I receive 100-200 messages every day ; this may not be
a lot to some people, but for me, it is) and I need to do
what I do for matters of duplication of messages in different folders.
Thanks for your understanding,
Denis Roegel