Shell script: Convert text to lowercase and uppercase

Shell script

s="Hello World!" 

echo $s  # Hello World!

a=${s,,}
echo $a  # hello world!

b=${s^^}
echo $b  # HELLO WORLD!

O/p

Author: bm on March 23, 2017
Category: ubuntu
Tags: ,

One thought on “Shell script: Convert text to lowercase and uppercase

  1. same way you can replace charecter eg

    APP_NAME=”hello world”
    APP_NAME=${APP_NAME// /_}
    echo $APP_NAME
    ——————
    op
    hello_world

Your comment:

Your Name

Comment:




Last articles