Just for the hell of it, here are untested reiterative INCLUDERCs for making
all letters in a single-line variable upper case or lower case.
Call them like this:
string=$variable # or string="text"
INCLUDERC=/path/to/.tolowerrc # or /path/to/.toupperrc
variable=$string
Here is .toupperrc:
ltou="aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ"
lead tail upper lower
:0D
* ! string ?? [a-z]
{ SWITCHRC=/dev/null }
:0D
* string ?? ^^\/[^a-z]*
{ lead=$MATCH }
:0D
* $ string ?? ^^$\lead\/[a-z]
{
lower=$MATCH
:0D
* $ string ?? ^^$\lead$lower\/.*
{ tail=$MATCH }
:0D
* $ ltou ?? $lower\/.
{ upper=$MATCH }
string=$lead$upper$tail
:0
* tail ?? ^^^^
{ SWITCHRC = $_ }
}
and comparably, here is .tolowerrc:
utol="AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz"
lead tail upper lower
:0D
* ! string ?? [A-Z]
{ SWITCHRC=/dev/null }
:0D
* string ?? ^^\/[^A-Z]*
{ lead=$MATCH }
:0D
* $ string ?? ^^$\lead\/[A-Z]
{
upper=$MATCH
:0D
* $ string ?? ^^$\lead$upper\/.*
{ tail=$MATCH }
:0D
* $ utol ?? $upper\/.
{ lower=$MATCH }
string=$lead$lower$tail
:0
* tail ?? ^^^^
{ SWITCHRC = $_ }
}
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail