Convert text to upper or lower case with bash

I had a spreadsheet with a list of lower case names that I needed to compare it with another spreadsheet with upper case names. I know there are lots of ways to do it, but I went to my Linux machine and was able to convert all the server names with a single line command in the bash shell.

cat FILENAME | tr “[:lower:]” “[:upper:]”

You could also drop this in a script as well if you are discovering servers.

echo $HOSTNAME | tr “[:lower:]” “[:upper:]”