procmail
[Top] [All Lists]

Troubles assigning chain of shell pipes to a variable

2005-06-14 23:40:06
I've written the following quick and crude recipe for extracting email
addresses from signatures:

  :0 b
  * 
  SIGADDRESS=|(tail -15 | 
    grep -i '\b[a-z]\{1,\}(_at_)[a-z]\{1,\}\.[a-z]\{3,\}\b' | 
    sed -e 's/^ *\([a-z1-9]\{1,\}(_at_)[a-z1-9]\{1,\}\.[a-z]\{3,\}\).*/\1/I')
  
That command line is really all one line.. I've just wrapped it here
for readability.  Here's what the log writes:
  
  procmail: Executing " (tail -15 | grep -i 
'\b[a-z]\{1,\}(_at_)[a-z]\{1,\}\.[a-z]\{3,\}\b' | sed -e 's/^ 
*\([a-z1-9]\{1,\}(_at_)[a-z1-9]\{1,\}\.[a-z]\{3,\}\).*/\1/I')"
  procmail: Assigning "SIGADD="
  procmail: [17765] Sun Jun 12 20:17:48 2005
  
Why doesn't anything get assigned to "SIGADDRESS"?

I know you purists have your jaws open, thinking I should be outcast
from the procmail community for not using straight up procmail code to
do this extraction.  I invite folks to post procmail code to do the
same thing.  However, I recall once before wanting to pipe a series of
external executables, and feed the result into a variable, and this
problem emerged.  Because this is a useful capability to have, I'd
like to find out specifically what's wrong with my syntax.

____________________________________________________________
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