procmail
[Top] [All Lists]

Re: executing line by line through a message

1997-10-24 10:19:12
Dan Smith wrote about Era Eriksson's advice to Matthew Saroff, which was:

E>    :0bw
E>    | while read url; do lynx -dump "$url" | $SENDMAIL -oi saroff ; done

S> there's a thread from earlier this week about doing the "while read
S> url" in procmail.  Turns out there is an undocumented "feature" with
S> $MATCH and leading blank lines, as well as a minor bug in 3.11pre7.

OK, then, let's deal with the possibility of blank lines in the body by
letting the shell hide them from lynx:

     :0bw
     | while read url; do case "$url" in; *://*) lynx -dump "$url" | \
       $SENDMAIL -oi $LOGNAME ;; ; esac; done

On another note, though, I wonder whether each page has to be mailed
separately:

     :0bw
     | while read url; do case "$url" in; *://*) lynx -dump "$url" ;; ; \
       esac; done | $SENDMAIL -oi $LOGNAME