Professional Documents
Culture Documents
Library M S Final Project
Library M S Final Project
Library M S Final Project
[For teachers use only: Don’t write anything inside this box]
Comments: Date:
Contents
1 Introduction ................................................................................................................................... 3
1.1 Overview ..................................................................................................................................... 3
1.2 Motivation .................................................................................................................................. 3
1.3 Problem Definition .................................................................................................................... 3
1.3.1 Problem Statement ................................................................................................................3
1.3.2 Complex Engineering Problem ............................................................................................. 4
1.4 Design Goals/Objectives ...........................................................................................................4
1.5 Application ..................................................................................................................................5
2 Implementation of the Project ................................................................................................... 6
2.1 Implementation ......................................................................................................................... 6
2.1.1 Define Constants .................................................................................................................... 6
2.1.2 Define Variables ......................................................................................................................6
2.1.3 Main Menu Function ............................................................................................................. 6
2.1.4 User Management Panel .......................................................................................................7
2.1.5 Book Management Panel ...................................................................................................... 8
2.1.6 End Screen Function .............................................................................................................. 8
2.1.7 User Management Functions ............................................................................................... 9
2.1.8 Modify User .............................................................................................................................9
2.1.9 List User ................................................................................................................................. 10
2.1.10 Search User ......................................................................................................................... 10
2.1.11 Delete User ......................................................................................................................... 11
2.1.12 Book Management Functions .......................................................................................... 11
2.1.13 Add Book ............................................................................................................................. 11
2.1.14 Modify Book ........................................................................................................................12
1
2.1.15 List Book .............................................................................................................................. 12
2.1.16 Search Book ........................................................................................................................ 13
2.1.17 Delete Book .........................................................................................................................13
2.1.18 Rent Book ............................................................................................................................ 14
2.1.19 List Rentals .......................................................................................................................... 14
2.1.20 Main Program Execution ...................................................................................................15
2.2 Algorithms ................................................................................................................................ 15
3 Performance Evaluation .............................................................................................................20
3.1 Results Analysis/Testing ......................................................................................................... 20
3.1.1 Main Menu ............................................................................................................................20
3.1.2 User Panel ..............................................................................................................................20
3.1.3 Add User ................................................................................................................................ 21
3.1.4 List of Users Record ..............................................................................................................21
3.1.5 Search users .......................................................................................................................... 21
3.1.6 Book Panel .............................................................................................................................22
3.1.7 Add Book ............................................................................................................................... 22
3.1.8 List Book .................................................................................................................................22
3.1.9 Search Book ...........................................................................................................................23
3.1.10 End Program ....................................................................................................................... 23
3.2 Results Overall Discussion ...................................................................................................... 23
4 Conclusion ....................................................................................................................................24
4.1 Discussion ................................................................................................................................. 24
4.2 Limitations ................................................................................................................................ 24
4.3 Scope of Future Work ............................................................................................................. 24
Chapter 1
2
Introduction
1.1 Overview
This Bash script project is a command-line Library Management System that allows
users to manage library records. It provides menus for both user and book
management panels, where users can add, modify, list, search, and delete records
for both users and books. Additionally, the system supports book rentals, tracking
rented books and updating book quantities accordingly. User interactions and data
manipulations are managed through text files for persistent storage, ensuring that all
records are maintained across sessions.
1.2 Motivation
• Streamlined Library Operations: Simplifies management of user and book
records in a library setting.
• Persistent Data Storage: Ensures data is stored and accessible across sessions
using text files.
3
1.3.2 Complex Engineering Problem
To address the attributes of a complex engineering problem for the Library
Management System project, the table can be filled as follows:
Table 1.1: Summary of the attributes touched by the Library management project
Name of the P Attributess Explain how to address
P1: Depth of knowledge required Understanding of Bash scripting and file
handling is crucial to develop the system.
P2: Range of conflicting Balancing user-friendly interface with robust
requirements functionality for library staff and patrons.
P3: Depth of analysis required In-depth analysis of library processes and user
needs to ensure all functionalities are
covered.
P4: Familiarity of issues Awareness of common library management
challenges like inventory tracking and user
management.
P5: Extent of applicable codes Adherence to coding standards and best
practices in Bash scripting to ensure
maintainability.
P6: Extent of stakeholder Involving library staff for requirements
involvement and conflicting gathering and feedback to align the system
requirements with actual needs.
P7: Interdependence Ensuring seamless integration of different
system modules like user management, book
management, and rental management.
1.4 Design Goals/Objectives
• Enhance Library Efficiency: Improve the management of library operations.
• Track Book Rentals: Accurately manage and monitor book rental activities.
• Maintain Data Integrity:Ensure persistent and reliable storage of user and book
information.
• Improve User Experience:Provide a simple and intuitive interface for library
staff and users.
4
1.5 Application
• VMware Workstation 17 Player.
• Kali Linux.
5
Chapter 2
2.1 Implementation
These lines define constants for the ASCII values of the ENTER, TAB, and BACKSPACE
keys. However, these constants are not used anywhere in the script.
These lines initialize variables. passTerminator and bookStock are set to 1 and 0
respectively, while rentName and bookName are initialized as empty strings. These
variables are not used in the script.
6
2.1.4 User Management Panel
This function displays the User Management Panel menu, reads user input, and
directs to the appropriate function based on the input. If the input is invalid, it
displays an error message and re-displays the menu after a short delay.
7
2.1.5 Book Management Panel
This function displays the Book Management Panel menu, reads user input, and
directs to the appropriate function based on the input. If the input is invalid, it
displays an error message and re-displays the menu after a short delay.
This function clears the screen, displays a thank you message, and exits the script.
8
2.1.7 User Management Functions
This function allows adding user records. It prompts the user for details, appends
the details to userRecords.txt, and asks if more records should be entered. If not, it
redirects to the User Panel.
This function modifies user details. It searches for a user by first name, allows
modifications if found, and updates the user record. If not found, it informs the user
and redirects to the User Panel.
9
2.1.9 List User
This function lists all user records, displaying each user’s details in a formatted
manner. It waits for user input before redirecting to the User Panel.
This function searches for a user by first name and displays the full record if
found. If not found, it informs the user. It waits for user input before redirecting to
the User Panel.
10
2.1.11 Delete User
This function deletes a user record by first name. It searches for the user,
removes the record if found, and updates the user records file. If not found, it
informs the user and redirects to the User Panel after a short delay.
This function allows adding book records. It prompts the user for details, appends
the details to bookRecords.txt, and asks if more records should be entered. If not, it
redirects to the Book Panel.
11
2.1.14 Modify Book
This function modifies book details. It searches for a book by name, allows
modifications if found, and updates the book record. If not found, it informs the user
and redirects to the Book Panel.
This function lists all book records, displaying each book’s details in a formatted
manner. It waits for user input before redirecting to the Book Panel.
12
2.1.16 Search Book
This function searches for a book by name and displays the full record if found. If
not found, it informs the user. It waits for user input before redirecting to the Book
Panel.
This function deletes a book record by name. It searches for the book, removes
the record if found, and updates the book records file. If not found, it informs the
user and redirects to the Book Panel after a short delay.
13
2.1.18 Rent Book
This function handles book rentals. It searches for a book by name, allows the
user to rent the book if it is in stock, updates the book quantity, and records the
rental details. If the book is out of stock or not found, it informs the user. It waits for
user input before redirecting to the Book Panel.
2.1.19 List Rentals
14
This function lists all rental records and waits for user input before redirecting to
the User Panel.
This line starts the script by calling the menu function, which displays the main
menu and handles user navigation through the library management system.
2.2 Algorithms
1. Initialize Constants and Variables:
15
• Read user input.
• Call the appropriate function based on the input.
• If input is invalid, display an error message and recall bookPanel.
16
•
Append the user details to userRecords.txt.
• Confirm the addition and ask if the user wants to add more records.
• If no, redirect to userPanel.
17
•
• Prompt for book details (Name, Author, Publisher, Book ID, Quantity).
• Append the book details to bookRecords.txt.
• Confirm the addition and ask if the user wants to add more records.
• If no, redirect to bookPanel.
18
•
• Clear the screen.
• Prompt for the name of the book to rent.
• Search bookRecords.txt for the book.
• If found and quantity is greater than zero, prompt for user details
and update the book’s quantity.
• If not found or out of stock, display an error message.
• Wait for user input to return to bookPanel.
19
Chapter 3
Performance Evaluation
In the main menu, we have to see two option.User management panel and Book
management panel. If we choose the user panel -
In the user management panel, we have to see more eight option. Every option have
different type of work.
20
3.1.3 Add User
21
3.1.6 Book Panel
In this figure, we have to see the Book management panel and see the eight option
in this interface.
So, we selected in the number one option and add book of this library program.
22
This is the list book section. Data store in text files.
Chapter 4
23
Conclusion
4.1 Discussion
This project implements a Library Management System using a Bash script. It allows
adding, modifying, listing, searching, and deleting user and book records. Users can
also rent books, and the system keeps track of these rentals. The menu-driven interface simplifies
navigation and management of library tasks, storing data in text files for easy access and updates. c
4.2 Limitations
• Limited to command-line interface; no graphical user interface.
• Data stored in plain text files, lacking database security and scalability.
References
• https://www.geeksforgeeks.org/implementing-directory-management-using-shell-s •
https://www.naukri.com/code360/library/implementing-directory-management-usin
• https://www.freecodecamp.org/news/bash-scripting-tutorial-linux-shell-script-
24