home

Quickies, by Andrea Olivato

text

String to upper or lower in #Bash

This shows how to convert a string to lower or upper using bash and tr utility.

STRING="myFAncyString";

# String to lower
echo $STRING | tr "[:upper:]" "[:lower:]";

# String to upper
echo $STRING | tr "[:lower:]" "[:upper:]";

Via spikesource

2 years ago

June 30, 2009
Comments (View)
blog comments powered by Disqus