procmail
[Top] [All Lists]

Re: question on scoring

1997-03-31 08:20:42
On Mon, 31 Mar 1997 17:01:42 +0300 (EET DST), I wrote:
I haven't measured whether the following is in fact more
resource-friendly; since I start up only one shell to do both the
logging and the grepping, I guess it's probably a bit more economical
than what you had. (You could try to do even more stuff in one shell
invocation if you don't care about the output of intermediate
commands.)

... and proceeded to nullify the possible savings by running backticks
from within that shell. I think I deserve some little applause ;-/

    * 1^1 ! ? exit `fgrep -cx "$FROM" $DATELOG`

This one in particular is up the wall. Use the normal backticks in the
original instead. 
  (If you wrote a variant of fgrep which returned the number of
matches in the exit code, you would again not need the exit and the
backticks but such programs are far between. The original rationale
for the ! ? construct was probably as a generalization for the case
where you would expect either an exit code of 1 to mean failure and 0
to mean success.)

/* era */

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>

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