Question: Write a PERL program that accepts a directory name on the command line. The program checks that there is exactly one command line argument, then

Write a PERL program that accepts a directory name on the command line.

The program checks that there is exactly one command line argument, then calls a sub. The sub finds all files in the directory that have 700 access permission (the owner has full permission, group and other users have no permission), and changes the access rights for these files so that everyone else can read the file (744 permission). The sub then prints the name and new access rights of all the changed files.

Sample output:

$ ls -l dir1 total 5 -rw-rw-rw- 1 ucn2140 staff 1970 Mar 3 16:24 lab3 -rw-rw-rw- 1 ucn2140 staff 298 Mar 3 16:24 lab3.soln1 -rw-rw-rw- 1 ucn2140 staff 306 Mar 3 16:24 lab3.soln2 -rwx------ 1 ucn2140 staff 553 Mar 3 17:21 lab4.soln1 -rwx------ 1 ucn2140 staff 180 Mar 3 17:21 lab4.soln2 $ lab6.soln2 dir1 dir1/lab4.soln1 744 dir1/lab4.soln2 744 $ lab6.soln2 Usage: lab6.soln2 dirname 

Turn in directory listings before and after your program runs, as well as the perl code and results.

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!