Write a menu driven shell script using the select statement to print calories for food items such as pizza, burger, Salad, Pasta etc
bin/bashfile=$1v=0
if [ $# -ne 1 ]
then
echo "$0 fileName"exit 1
fi
if [ ! -f $file ]
then
echo "$file not a file"exit 2
fi while read -n 1 cdol=$(echo $c | tr [:upper:] [:lower:])[[ "$l" == "a" || "$l" == "e" || "$l" == "i" || "$l" == "o" || "$l" == "u" ]] &&(( v++ ))
done < $file
echo "Vowels : $v"
echo "Characters : $(cat $file | wc -c)"
echo "Blank lines : $(grep -c '^$' $file)"
echo "Lines : $(cat $file|wc -l )"
Comments
Leave a comment