BASH tr command

Posted by user1457809 on Stack Overflow See other posts from Stack Overflow or by user1457809
Published on 2012-06-22T15:13:10Z Indexed on 2012/06/22 15:16 UTC
Read the original article Hit count: 241

Filed under:
|
|
|
|

Id like to convert it to uppercase for the simple purpose of formatting so it will adhere to a future case statement. As I thought case statements are case sensitive.

I see all over the place the tr command used in concert with echo commands to give you immediate results such as:

echo "Enter in Location (i.e. SDD-134)"
read answer (user enters "cfg"

echo $answer | tr '[:lower:]' '[:upper:]'   which produced

cfg # first echo not upper?

echo $answer #echo it again and it is now upper...

CFG

© Stack Overflow or respective owner

Related posts about linux

Related posts about bash