procmail
[Top] [All Lists]

Re: question on scoring

1997-03-31 14:36:03
On Mon, 31 Mar 1997 15:18:55 -0600 (CST),
dattier(_at_)wwa(_dot_)com (David W. Tamkin) wrote:
Era Eriksson wrote,
|   (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.)
Some programs do return the number of occurrences of something in their
exit code, don't they? 

I honestly tried to think of programs that do this and couldn't think
of any useful ones. I'm probably displaying more of that ole ignorance
here. Aren't exit codes supposed to be smallish integers, meaning few
programs could do this and remain generally useful? 

Regardless, the stdout of a command can be used
in a score this way:

  * $ `fgrep -cx "$FROM" $DATELOG`^0

That's one of the things again where I could see the use of some more
practical examples in the documentation. Thanks for this one, I'll
cherish it :-)

/* era */

... and that, incidentally, brings us back to square one (albeit wiser)

-- 
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>