single-project

User Input Analysis and File Management Shell Scripting

Practical Shell Scripting for Database Management and Permission Control
Essence

User Input Analysis and File Management Shell Scripting

In this project, I created and executed shell scripts to manage user inputs and file permissions on a Linux system. I began by writing a script called myscript that displayed a welcome message explaining its purpose: adding entries to a family database. I scripted prompts for the user to input a name, relationship, and telephone number, then appended this information to a file named database. After granting execute permissions to the script, I successfully ran it and verified that the new entries were correctly saved.

Next, I enhanced myscript by adding a search functionality. I modified the script to ask users whether they wanted to search the database after adding entries. If the user chose to search, the script would prompt for a search term and then display any matching results from the database. To improve script management, I refactored the logic using a case statement to handle different user choices: add a record, search the database, or quit the program, making the script more organized and user-friendly.

In the second part of the project, I created another script called myscript3 for permission management. This script listed all previously created scripts in the home directory, modified their permissions to ensure that only the root user had full rights, and displayed the updated permissions for verification. I granted execute permissions to myscript3, executed it, and confirmed that the permission changes were applied correctly. This project demonstrated my practical skills in bash scripting, user input handling, file management, and system permission control.