linux poison RSS
linux poison Email

Bash Script: Convert String Toupper and Tolower

Here is a simple bash script which converts the given string to upper or to lower case.
feel free to copy and use this script:


echo -n "Enter the String: "
read String

echo -n "Only First characters to uppercase: "
echo ${String^}

echo -n "All characters to uppercase: "
echo ${String^^}

echo -n "Only First characters to Lowercase: "
echo ${String,}

echo -n "All characters to lowercase: "
echo ${String,,}

Enter the String: linuXPoisoN
Only First characters to uppercase: LinuXPoisoN
All characters to uppercase: LINUXPOISON
Only First characters to Lowercase: linuXPoisoN
All characters to lowercase: linuxpoison


Post a Comment

Related Posts with Thumbnails