Tuesday, 11 June 2013

Shell Program to find the type of the character entered

echo Enter any character
read c
case $c in
[a-z]) echo Small Case letter;;
[A-Z]) echo Capital letter;;
[0-9]) echo digit;;
    ?) echo special symbol;;
    *) echo more than one character, reenter;;
esac

11)#Program to find the pattern

echo Enter the word
read str
case $str in
[aeiou]*) echo The word begins with a vowel;;
  [0-9]*) echo The word starts with a digit;;
  *[0-9]) echo The word ends with a digit;;
    ????) echo The word entered is 4 lettered word;;
       *) echo The word entered is either starts with a
          consonant or incorrect input;;
esac

No comments:

Post a Comment