Sunday, December 2, 2012

Check Given Word Using Switch Case Shell Script | Shell Programming


Write a shell script to determine whether the given word begins with lower case or uppercase letter check whether it is three character word or whether it is starting with a special character

Check Given Word Using Switch Case Shell Script | Shell Programming


Accept Input from User as Word then using Switch case we can find out given Word in lower case or uppercase , whether it contain Special character or Its Three character




#!/bin/bash
#Program for Checking Lower or Upper Case
#Program from Nullpointer.in
echo "Enter a String"
read str
case $str in
??? && [a-z]*)
echo "String is of 3 Character And in lower case"
;;
[a-z]*)
echo "Given String is lower Case"
;;
[A-Z]*)
echo "Given String is Upper Case"
;;
[?{}!@#$^%+-]*)
echo "Given String Start with Special Character"
;;
*)
echo "Wrong input....!!!"
;;
esac

0 comments:

Post a Comment