Linux Shell Scripting Projects for Beginners | Address Database
Linux Shell Scripting Projects for Beginners – Address Database

Project Brief
Address Database tool one of the BASH shell based Linux Shell Scripting Projects that is providing various operations to handle a particular database.
About this project
TYPE | Individual project |
DIFFICULTY | Advanced |
ESTIMATED TIME | 50 hours |
PUBLISHED | 15th March, 2021 |
CONTACT | training@emertxe.com |
Introduction
Address Database is one of the BASH shell based Linux Shell Scripting Projects that is providing various operations to handle a particular database. Initially the data-base need to be pre-populated with some data for which the user will be provided with a set of commands (ex: add / modify / delete / search) using which he should be able to modify them. Practically database operations are performed in web applications whenever they are dealing with data. Popularly known as CRUD (Create / Read / Write / Delete) operations, they mainly help to deal with the backend database.
The idea of this project is to implement an address book database management system using BASH Shell scripting and a local text based database. Along with this user functionality, this tool should record all the actions performed along with time-stamps for future references. Since the idea of this tool is to exposure SHELL programming, CSV file is used as a data-base storing entity. By implementing this project you will get a basic understanding of data-base operations, timeout handling, command parsing using various shell commands. By building this Linux Shell Scripting Projects you will be able to get a real feel of Automation and Application Development in Linux.
Requirement Details
Following are the requirements for this Linux Shell Scripting Project. They are categorized into various functional areas.
- Activity log file:
- Every activity while the script is to be logged in file named database .log.
- Attach timestamp to every entry.
- Working environment settings:
- Should create a directory called “Database” in user’s home directory structure tree, ECEP/LinuxSystems/Projects directory if it doesn’t exist.
- Create a file named “database.csv” under Database directory if it doesn’t exist.
- Check the existence of at least one valid data entry in database.csv.
- If the file is empty, script should only prompt for data addition unless and until it gets a valid entry to display.
- User interface:
- The script should have the following functionalities as listed below
- Add Entry
- Search / Edit Entry
- Add Entry:
When the user selects the “Add Entry” option it should have the following fields to be added
- Name
- Accept the user entry in any case but convert it to sentence case while storing.
- Accept only alphabets and spaces
- Accept only symbols like “.”, “_”, alphabets, and numbers. Validate for “@” and a “.” after it
- Telephone Number
- Accept only numbers
- Mobile Number
- Add country code (assume Indian customers)
- Validate for 10 digit entry
- Accept only numbers
- Place
- Accept the user entry in any case but convert it to sentence case while storing
- Accept only alphabets and spaces
- Message
- Any character allowed
- No formatting has to be done, user entry has to be captured as is.
- Proper formatted output
When the user finishes all the above fields the information has to be stored with current “date” and “time” automatically
- Time-out:
The script should time out if the user input is absent for more than 10 seconds.
Skeleton Code
The skeleton code in a very interesting concept used in Emertxe. By looking into the skeleton code, you will get a clear picture into converting the given requirement into a working solution. This will also take care of important aspects like modularity, clean coding practices, re-usability etc.
Sample Output
Here are the sample output expected by the end of project execution.

Fig1: Main Menu. Proceeding towards Add Entry

Fig2: Add Entry Screen

Fig3: Adding a new Contact with help of Name

Fig4: View of added contact. Proceeding to add Mobile Number

Fig5: Adding Mobile Number

Fig6: Updated contact view. Proceeding to previous screen

Fig7: Main Menu. Proceeding towards Search / Edit Entry

Fig8: Search Menu. Observe the color highlight, The Edit Menu would be similar once the item is searched

Fig9: Search Menu. Proceeding towards Search by Name

Fig10: The name to be Searched

Fig11: Search Result. Observe the color highlight, its in Edit Menu now, Proceeding to add Place field

Fig12: Adding Place

Fig13: Updated screen with Place. Proceeding to Save

Fig14: Proceeding to Exit Search / Edit Screen

Fig15: Back to Main Screen. Proceeding to Exit Script

Fig16: The contact database in .csv file format

Fig17: Assuming multiple entries with same n, This is how the Search result should be shown. Selecting 2 entry to Edit

Fig18: Selection of 2nd user to Edit