Why am I getting this "bad replacement" error in my bash command?

when I run this, I get this "bad replacement" 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 the upper cases.

+4
source share
1 answer

Your method only works in bash 4. Try the following:

 echo $x | tr '[az]' '[AZ]' 
+6
source

Source: https://habr.com/ru/post/1479440/


All Articles