Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #write a shellscript simple library mangment system database file contain fiedls like account number, title, author, addition(1st,2nd etc), Publistion.
- #View Record
- #Add Record
- #Delete Record
- #Count Total Number Of Record
- #Get The Name Of Publiser Particale Name Of Author
- #Exit
- i=1;
- j=1;
- echo -n "Enter Database Name : "
- read lib
- while [ $i = 1 ]
- do
- echo "-----------------------------------"
- echo "1. Add Library Record."
- echo "2. View Library Record."
- echo "3. Delete Library Record."
- echo "4. Total Count Record."
- echo "5. Get Name Of The Publiser."
- echo "6. Exit."
- echo "-----------------------------------"
- echo -n "Enter Choose : "
- read ch
- case $ch in
- 1) #Add_Record
- echo -n "Book Number : "
- read bk_num;
- echo -n "Book Title Name : "
- read title;
- echo -n "Author Name : "
- read author;
- echo -n "Addition : "
- read add;
- echo -n "Publiser Name : "
- read pub;
- echo "$bk_num | $title | $author | $add | $pub" >> $lib;
- ;;
- 2) #Display_List
- sort -n -k1 $lib;
- ;;
- 3) #Delte_Record
- grep -v "$bk_num" $lib > delete.txt
- rm $lib
- mv delete.txt $lib
- ;;
- 4) #Total_Count_Record
- echo "Total | Database"
- wc -l $lib;
- ;;
- 5) #Get_Name_Of_Publiser
- cut -d "|" -f5 $lib > PName.txt
- cat PName.txt
- ;;
- *) exit
- ;;
- esac
- echo -n "Do You Want To Conti... (1 Conti.. / 2 Exit) ? "
- read i
- echo "-----------------------------------"
- if [ $i = 0 ]
- then
- exit
- fi
- done
Add Comment
Please, Sign In to add comment