Answer to Question #292720 in UNIX/Linux Programming for Lavu

Question #292720

Write a menu driven shell script using the select statement to print calories for food items such as pizza, burger, Salad, Pasta etc



1
Expert's answer
2022-02-05T02:04:24-0500
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 )"

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS