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 ;)
Read more...
$ x="samar"
$ echo "${x^}"
Samar
$ echo "${x^^}"
SAMAR
$ y="${x^^}"
$ echo $y
SAMAR
$ echo "${y,}"
sAMAR
$ echo "${y,,}"
samar
I hope this helps ;)
Read more...
Uppercase and Lowercase Conversion - Bash Style
2015-02-08T17:00:00+05:45
Cool Samar
bash|tricks and tips|
Comments
Labels:
bash,
tricks and tips
Bookmark this post:blogger tutorials
Social Bookmarking Blogger Widget |
Subscribe to:
Comments (Atom)