Question: Unix in bash please 4.1 Part 1 [12 pts] Write a script using simple shell commands. The script takes a command line argument that specifies
Unix in bash please
![Unix in bash please 4.1 Part 1 [12 pts] Write a script](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3c520331ce_74366f3c51f86c84.jpg)
4.1 Part 1 [12 pts] Write a script using simple shell commands. The script takes a command line argument that specifies a directory dir. The script first changes directory to dir, then prints the following in sequence: 1. A line starting "Current username is: ". Then on the same line, the current username. 2. A line starting "Current directory is : ". Then, on the same line, the absolute pathname of the current working directory. 3. A line starting "Home directory is: ". Then, on the same line, the absolute pathname of the home directory 4. An empty line 5. The line "- 5 most recently modified directories with rwxrwxrwx 6. the 5 most recently modified subdirectories with rwxrwxrwx permission in the current directory in long listing format (most recent first) 7. An empty line 8. The line "- Files in last 30-60 minutes" 9. The files in the current directory that are modified more than 30 minutes ago, but less than 60 minutes ago 10. An empty line, followed by a line of 70 equal signs Run your script three times, with three different input directories. Append the output of each script execu- tion to a file called q4_pl.txt Note that you may assume that there are at least 5 directories in an input directory 4.1 Part 1 [12 pts] Write a script using simple shell commands. The script takes a command line argument that specifies a directory dir. The script first changes directory to dir, then prints the following in sequence: 1. A line starting "Current username is: ". Then on the same line, the current username. 2. A line starting "Current directory is : ". Then, on the same line, the absolute pathname of the current working directory. 3. A line starting "Home directory is: ". Then, on the same line, the absolute pathname of the home directory 4. An empty line 5. The line "- 5 most recently modified directories with rwxrwxrwx 6. the 5 most recently modified subdirectories with rwxrwxrwx permission in the current directory in long listing format (most recent first) 7. An empty line 8. The line "- Files in last 30-60 minutes" 9. The files in the current directory that are modified more than 30 minutes ago, but less than 60 minutes ago 10. An empty line, followed by a line of 70 equal signs Run your script three times, with three different input directories. Append the output of each script execu- tion to a file called q4_pl.txt Note that you may assume that there are at least 5 directories in an input directory
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
