procmail
[Top] [All Lists]

Re: Getting files

1998-01-13 14:37:32
Era Eriksson wrote,

| Jari's pm-tips contains a trick for canonicalizing case in variable
| matches, originally due to David Tamkin. It's a nice trick, but it
| requires you to have a list of all requestable files in the recipe. 

That's because it wasn't intended for requestable files but rather for
a single user's mailing list subscriptions; the advantage of the trick
was that it worked within procmail instead of running a shell and tr.

To honor case-insensitive requests for files from a large library, it
doesn't pay to adapt that trick and to have to keep changing the list
for the recipe every time you add a file.  Use tr as Era suggested,

        FILE=`echo "$MATCH" | tr A-Z a-z`

or better yet, use it only if it is needed:

       :0Di
       * MATCH ?? [A-Z]
       FILE=| echo "$MATCH" | tr A-Z a-z

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