Algorithm for count the number of vowel in a string in shell script
Answers
Answered by
6
this is the script:
clear echo read str len=`expr length $str` count=0 while [ $len -gt 0 ] do ch=`echo $str | cut -c $len` case $ch in [(aeiouAEIOU)] count=`expr $count + 1` echo $ch ;; len=`expr $len - 1` done echo $count
clear echo read str len=`expr length $str` count=0 while [ $len -gt 0 ] do ch=`echo $str | cut -c $len` case $ch in [(aeiouAEIOU)] count=`expr $count + 1` echo $ch ;; len=`expr $len - 1` done echo $count
Similar questions