How can I achieve casing text like this:
string="this is a string"
for case in u l c
do
declare -"${case}" out
out=$string
echo $out
done
#THIS IS A STRING
#this is a string
#This is a string
with looping through the names of declared variables:
declare -u UPPER
declare -l LOWER
declare -c CAPITALIZE
for i in UPPER LOWER CAPITALIZE
do
i=$string
echo $i
done
#this is a string
#this is a string
#this is a string
(note all lower case)