bash - Convert string in variable lower case -
this question has answer here:
- converting string lower case in bash 17 answers
using bash version 3.2.57(1)-release (x86_64-apple-darwin14)
how can 're-assign' or 'change' existing value read variable.
if user inputs string iamstring
, i'd propinput
store value iamstring
. i'm printing console example sake.
read userinput echo ${userinput} | tr '[:upper:]' '[:lower:]'
you should store output of echo :
read userinput userinput=$(echo "$userinput" | tr '[:upper:]' '[:lower:]')
Comments
Post a Comment