procmail
[Top] [All Lists]

Re: Variable testing

1997-07-24 15:34:00
bts8(_at_)netcom(_dot_)com writes:
Would these be considered equivalent?

* WHO ?? ? $GREP -i $PMDIR/testfile

* ? $GREP -i "$WHO" $PMDIR/testfile

No.  The first is mostly equivalent to:

        echo "$WHO" | $GREP -i $PMDIR/testfile

There the pattern is "$PMDIR/testfile", and you're looking for that
in $WHO.  In the second condition, the pattern is "$WHO", and you're
looking for that in the file "$PMDIR/testfile".

What you're probably looking for is:

        * WHO ?? grep -if $PMDIR/testfile

That'll use the contents of $PMDIR/testfile as the pattern(s), and try
to match it/them against the value of the WHO variable.

BTW: do you have particular reason for using $GREP instead of just saying
"grep"?  What do you think this gets you?


Philip Guenther

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