Use the below code: menu.sh
# ***** Code Starts here *****
until [ "$verify" = n ]
do
echo "1) Add new book"
echo "2) Remove existing book info"
echo "3) Update book info and quantity"
echo "4) Search for book by title/author"
echo "5) Process a book sold"
echo "6) Inventory summary report"
echo "7) Quit"
echo "select a menu"
read pattern
case $pattern in
1)
echo "******Add new book*********"
echo "Enter book name to create a new book"
read bookname
touch $bookname
;;
2)
echo "******Remove existing book info*********"
echo "Enter book name to remove the info"
read bookname
echo "" | cat>$bookname
;;
3)
echo "******Update book info and quantity*********"
echo "Enter book name to update the info"
read bookname
echo "enter text(title/author)"
read text
echo $text | cat>>$bookname
;;
4)echo "******Search for book by title/author*********"
echo "Enter title/author to search a book"
read title
echo "See the below list of files(books) having the entered title/author"
find . -exec grep "$title" '{}' \; -print
echo $text | cat>>$bookname
;;
6)
echo "******Inventory summary report*********"
echo "Enter book name to view the Inventory summary report"
read bookname
cat $bookname
;;
7)
exit case
;;
esac;
echo "Do u want to continue(Y/N)"
read verify
done
# ***** code ends here *****