bash - how to get the result of an echo into a variable
Here is how you assign what comes back from an echo statement to a bash variable.
How to assign the result of echo to a variable in bash script
MY_CHOICE=`echo $1 | tr "[:lower:]" "[:upper:]"`