Question: 2. Listing and sorting directories Create a Bash script that accepts directory paths as arguments. For each argument, list the contents of each directory with

2. Listing and sorting directories

Create a Bash script that accepts directory paths as arguments. For each argument, list the contents of each directory with the name of each listed at the top.

If you want to give yourself an added challenge, have your script accept an additional argument, a or d, that sorts the contents of each directory in either ascending or descending order. For even more of a challenge, create a Bash script that sorts the contents of the directories based on an a or d argument that directly precedes it. In other words, you should be able to sort one directory in ascending order, a second directory in descending order, and so on.

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!