Unformatted text preview:

Mini Project 1 -- Practice on Shell Programming Please email to [email protected] Due : Oct. 25 2008 Name: . Write a bsh(or sh or Bash) script which manages a book library database. The script should allow the user to add books to the database, check in/out a book, display books, print sorted reports and delete books. The script should be menu-based with the following options: Main Menu: (e) Edit Submenu (r) Report Submenu (q) Quit Edit Submenu: (a) Add a book (p) Display a book (i) Checkin book (o) Checkout book (d) Delete a book (q) Return to Main Menu Report Submenu: (a) Sort by Author (t) Sort by Title (c) Sort by Status(q) Return to Main Menu Each book entry should consist of a Title, Author, Status, Borrower's name, and Check Out date. The status of a book could be in or out. The check out date and borrower's name would be empty if the status of a book is in. The book entries must be kept in a text file (called .books) in the user's home directory with the following format: Database Systems:ElMasri:out:12/5/07:Jones Java Programming:King:out:10/12/07:Smith Bioinformatics:Alex Zelikovsky:out:9/8/07:Yang Oracle Programming:Sunderraman:in The title of the book serves as the primary key, i.e. we cannot have two books with the same title. The options within the Report submenu should produce a well formatted listing of the books. Each of the sub-options in the Edit sub-menu should interact with the user as follows: (a) Add a book: should prompt the user for the following: Book Title: Author: This option should check to see if there is a book with the same title; If present, an error message should be generated otherwise the book should be added to the database. (p) Display a book: should prompt the user for the book title: Book Title:After reading the book title, this option should verify if the book is present in the database; If not present an error message should be generated otherwise the book should be displayed in a nice format. (i) Checkin book: should prompt the user for the book title: Book Title: After reading the book title, this option should verify that the book exists and that it is checked out. If so, then the status should be changed in the database, otherwise an error message should be generated. (i) Checkout book: should prompt the user for the book title and borrower's name: Book Title: Borrower: After reading the book title and name, this option should verify that the book exists and that it is checked in. If so, the status should be changed in the database, otherwise an error message should be generated. The system date should be used to update the checkout date. (i) Delete book: should prompt the user for the book title: Book Title: After reading the book title, this option should verify that the book exists and that it is not checked out. If so, then the book entry should be deleted in the database, otherwise an error message should be generated. Each of the sub-options in the Report sub-menu should interact with the user as follows:(a) Sort by Author: should print a well formatted listing sorted by author name of all the books in the database. Try to fit a few entries per screen and allow user to hit enter key to view next page. (t) Sort by Title: same as (a) but sorting is on title. (c) Sort by Status: same as (a) but sorting is on status (in or out); List all out books first then in


View Full Document

GSU CSC 3320 - Project1

Download Project1
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Project1 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Project1 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?