Question: Write a shell script (script2.sh) to traverse the directory structure from current directory (recursively, that is, to traverse left-to-right depth-first manner) and (1) to print

Write a shell script (script2.sh) to traverse the directory structure from current directory (recursively, that is, to traverse left-to-right depth-first manner) and (1) to print the current path (with pwd command using system("pwd") call) and (2) to print any file/directory entries (with ls command, using system("ls") call). Your program should print the result of each pwd from current-directory path name, then to the path name of dir1, and then dir4 and so on.

Copy and paste your shell script

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!