4.16. How do I convert a string to all lowercase or capital letters?
The easiest method is to use a new version of GNU sed, ssed, sedmod
or sed16 and employ the \U, \L, or other switches on the right side
of an s/// command. For example, to convert any word which begins
with "reg" or "exp" into solid capital letters:
sed -r "s/\<(reg|exp)[a-z]+/\U&/g" # gsed4.+ or ssed
sed "s/\<reg[a-z]+/\U&/g; s/\<exp[a-z]+/\U&/g" # sed16 and sedmod
As you can see, sedmod and sed16 do not support alternation (|),
but they do support case conversion. If none of these versions of
sed are available to you, some sample scripts for this task are
available from the Seder's Grab Bag:
https://sed.sourceforge.net/grabbag/scripts
Note that some case conversion scripts are listed under "Filename
manipulation" and others are under "Text formatting."