when I run this I get this 'bad substitution' error. What can I do?
$ x="Hello World"
$ echo "$x"
Hello World
$ echo "${x^^}"
-bash: ${x^^}: bad substitution
EDIT: I would like to have it in all upper case.
Your method only works in bash 4. Try this:
echo $x | tr '[a-z]' '[A-Z]'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With