Sunday, 8 February 2015
Uppercase and Lowercase Conversion - Bash Style
After a long long time, I am back with this short post to convert case of strings in bash. While you might have been using tr (Like I did for a while) for this purpose, bash 4 has a built-in way for the case conversion.
Withour further ado, here is a session
I hope this helps ;)
$ x="samar" $ echo "${x^}" Samar $ echo "${x^^}" SAMAR $ y="${x^^}" $ echo $y SAMAR $ echo "${y,}" sAMAR $ echo "${y,,}" samar
I hope this helps ;)
Labels:
bash,
tricks and tips
Bookmark this post:blogger tutorials
Social Bookmarking Blogger Widget |
Uppercase and Lowercase Conversion - Bash Style
2015-02-08T17:00:00+05:45
Cool Samar
bash|tricks and tips|
Subscribe to:
Post Comments (Atom)