Simple Library Management System Operations using Linux shell script in Ubuntu
echo enter choice
echo "1.view records based on query"
echo "2.add records"
echo "3.delete records"
echo "4.total no of records"
echo "5.view all records"
echo "6.update all records"
read choice
case $choice in
1)echo "enter title of book:-"
read title
grep -i $title library_data.txt
;;
2)echo "enter Account no:-"
read accno
echo "enter title of book:-"
read title
echo "enter name of author:-"
read author
echo "enter no of edition:-"
read edition
echo "enter publisher:-"
read publisher
echo $accno"|"$title"|"$author"|"$edition"|"$publisher>>library_data.txt
echo "Data inserted successfully"
;;
3)echo "enter title of book:-"
read title
grep -v "$title" library_data.txt>library_data1.txt
cp library_data1.txt library_data.txt
echo "Record deleted successfully"
;;
4)cat library_data.txt | wc -l
;;
5)cat library_data.txt
;;
esac