I need to create a shell script having the menu with few options such as
-
Listing 2. Change permissions 3. Modify Contents 4. Delete Files 5. Exit
-
For 1. Listing: Display a special listing of files showing their date of modification and access time (side by side) along with their permissions, sizes and filenames. The script should accept any number of arguments to display a selective listing and should abort if no filenames are specified as arguments. Provide headers for the columns and take care of all validations.
Note: Files have to be searched in present working directory only -
For 2. Change permissions: Accept files and the permissions to be made available. Change the permissions accordingly.
-
For 3. Modify Contents: Accept a file name and use any editor to modify the contents as per user's choice
Note: Consider only .txt files, else modifying contents of binary files will lead to them being corrupted. So, exit if file is not a .txt file. -
For 4. Delete Files: Accept a file name(s) and delete the file if available, else display error message
-
For 5. Exit : Exit the application
-
For implementing these options use getopts command appropriately.
can some one help me ?
Thanks in advance