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++: Boost interprocess memory mapped file error -

python - IO.UnsupportedOperation: Not Writable -

python - Selecting distinct values from a column in Peewee -