procmail
[Top] [All Lists]

Re: procmail and ifile

2002-08-20 19:22:14
in message <200208201249(_dot_)g7KCnQw27324(_at_)panix2(_dot_)panix(_dot_)com>,
wrote dman(_at_)nomotek(_dot_)com thusly...

[ObDigression: skip reading this if you have no interest in Bourne-
shell scripting.]

From: parv <parv_fm(_at_)emailgroups(_dot_)net>

i almost missed the back-quotes.  if "$()" construct had been used
instead, i wouldn't have to re-read 4-5 times just to reconcile the
interaction between "[" (test) & the external commands.

True (and the original is admittedly messy to the point of being
creepy); but not all sh's understand $().

true...


  #!/bin/sh
  PATH=/usr/bin:/usr/local/bin

  { ifile -q -v 0 | grep -q '^spam' ; }  &&  exit 0
  exit 1

I have no idea what ifile is; 

neither do i...


Assuming a POSIX-compatible grep (see "man grep" for cautions
about the -s and -q flags), how about

yeah, i was alluding to the same warnings when i mentioned "gnu"
& "grep" in the same sentence...


   { ifile -q -v 0 | grep -qs '^spam' ; } || exit 1

...even better.  all i can say, i was in the zone... tunnel vision
zone that is.


So why do we need a script?

      :0 flags
      * ? ifile -q -v 0 | grep -qs '^spam'
      { your action on success }

'cause it's so much fun! :)

i don't know; only OP can answer that.


  - parv

-- 

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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