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++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -