The use of tr [:lower:] [:upper:] can be problematic depending on LOCALES. It throws the following error:
tr: misaligned [:upper:] and/or [:lower:] construct
This is because in certain LOCALES the number of lower and upper case characters is different.
I would suggest the use of tr '[a-z]' '[A-Z]'.