procmail
[Top] [All Lists]

Re: Changing the case of a variable

2003-07-16 11:45:37
The dairybeast mused,

I want to change the case of a variable that is created via a $MATCH to
be all lowercase.

Aim horizontally and shoot the tops off all the letters.  It's fun!

so I tried:

NEWVAR=`echo $OLDVAR | tr "[:upper:]" "[:lower:]" `

Now, is there a better way that doesn't involve calling echo and tr?

We've discussed it on the list in the past. Try searching the archives for "tolower" or "toupper" if you want, but doing it within procmail is so messy that you might prefer to do it as you already are, despite the need for a shell and tr (and echo if your shell doesn't have echo built in).


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