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

c - How to retrieve a variable from the Apache configuration inside the module? -

c# - Constructor arguments cannot be passed for interface mocks -

python - malformed header from script index.py Bad header -