Question: [5] Open with QUESTION No. 02 [20] Write a script that displays a main menu and perform tasks based on the input value. Valid input

 [5] Open with QUESTION No. 02 [20] Write a script that

[5] Open with QUESTION No. 02 [20] Write a script that displays a main menu and perform tasks based on the input value. Valid input values = {1, 2, 3, 4, exit). The different options 1,2,3,4 will display the output as follow: 1. Input a filename from user and display permissions of that particular file. Then invert the permissions e.g. If permissions were r-x change them to-w-. Then again display the updated permissions of that file. 2. Input a filename and a string and search it in the file. Output the lines of file where that string is found. But if the string contains a dot(.) it means any character can fill the place. For example: [5] string = c.t = {cat, cot, ct. 3. Create a file dummy.txt and add the content of all the files in the current directory to dummy. But copy the content in such a way that if files in current directory = {fl, 12, f3, 14, ..., fn}. Then copy first N lines of files at even location (12.14.) and last N lines of files at odd location (11,83,. ). Input value of N from user. [5] 4. Input a filename from user and check modified date of that file. If modified date is greater than 24 hours from the current time change the modified date to current date. Along with displaying the output on terminal, maintain a log file that contains the information of the script. Format of the log file is given below: 151 Format of the log File Option 01 selected at date and time File name: filename.bet Permissions of filename.txt: Show permissions Permissions changed Updated Permissions of filename.txt: Show permissions Option 02 selected at date and time Filename: filename.txt String: string Output all the lines in filename where string is found. Option 03 selected at date and time Files a Page @c20n!1.3.15 Q + Files at even location. 7.19 [5] Open with QUESTION No. 02 [20] Write a script that displays a main menu and perform tasks based on the input value. Valid input values = {1, 2, 3, 4, exit). The different options 1,2,3,4 will display the output as follow: 1. Input a filename from user and display permissions of that particular file. Then invert the permissions e.g. If permissions were r-x change them to-w-. Then again display the updated permissions of that file. 2. Input a filename and a string and search it in the file. Output the lines of file where that string is found. But if the string contains a dot(.) it means any character can fill the place. For example: [5] string = c.t = {cat, cot, ct. 3. Create a file dummy.txt and add the content of all the files in the current directory to dummy. But copy the content in such a way that if files in current directory = {fl, 12, f3, 14, ..., fn}. Then copy first N lines of files at even location (12.14.) and last N lines of files at odd location (11,83,. ). Input value of N from user. [5] 4. Input a filename from user and check modified date of that file. If modified date is greater than 24 hours from the current time change the modified date to current date. Along with displaying the output on terminal, maintain a log file that contains the information of the script. Format of the log file is given below: 151 Format of the log File Option 01 selected at date and time File name: filename.bet Permissions of filename.txt: Show permissions Permissions changed Updated Permissions of filename.txt: Show permissions Option 02 selected at date and time Filename: filename.txt String: string Output all the lines in filename where string is found. Option 03 selected at date and time Files a Page @c20n!1.3.15 Q + Files at even location. 7.19

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!