I found solution but it doesn't working http://www.cyberciti.biz/faq/linux-unix-shell-programming-converting-lowercase-uppercase/
[root@mg0016 tmp]# y="this Is A test"
[root@mg0016 tmp]# echo "${y^^}"
-bash: ${y^^}: bad substitution
I found solution but it doesn't working http://www.cyberciti.biz/faq/linux-unix-shell-programming-converting-lowercase-uppercase/
[root@mg0016 tmp]# y="this Is A test"
[root@mg0016 tmp]# echo "${y^^}"
-bash: ${y^^}: bad substitution
You can use any one of the following code :
$ tr '[:lower:]' '[:upper:]' < input.txt > output.txt
or
$ sed -e 's/\(.*\)/\U\1/' input.txt > output.txt
sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' input.txt > output.txt
.
Commented
Oct 11, 2012 at 17:51
I found following one! and it works!
[spatel@mg0016 ~]$ echo "lower" | awk '{print toupper($0)}'
LOWER
Thanks for reply all.
y="this Is A test"; y=${echo $y|tr "a-z" "A-Z"}
;echo y: $y`