How to change Case of a string(BASH Scripting)?
Is there any inbuilt functionality in Unix shell script so that i can able to convert lower case string input to an upper case?
I dont want to use high level languages like java,python or perl for doing the job. |
Code:
tr a-z A-Z filename |
Quote:
Code:
$ echo 'my string' | tr 'a-z' 'A-Z' |
I believe you can try "cat <name of file> | tr 'a-z' 'A-Z'" (without the < > or " ") to go from lower case to uppercase. Consequently "cat <name of file> | tr 'A-Z' 'a-z'" would take you from upper case to lower case.
cat myfile | tr 'a-z' 'A-Z' |
Ok, simply put you could do this:
export lower=somevalue export lower=`echo $lower | tr 'a-z' 'A-Z'` |
All times are GMT -5. The time now is 08:07 AM. |