bash - Convert string in variable lower case -


this question has answer here:

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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -