Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

-To be done in UNIX shell Bash scripting In many command line interfaces, there is a command called tree that either already exists or you

-To be done in UNIX shell Bash scripting

In many command line interfaces, there is a command called tree that either already exists or you can download via a package manager. Delmar doesn't let us do that, unfortunately, so we'll have to build our own.

For this project, your goal is to create a command line tool that takes in a directory, and prints all of its subdirectories in a formatted fashion. For example, suppose I pass in a directory with its own subdirectories for a project:

 example-app |-- pom.xml |-- src | |-- main | | `-- java | | `-- main | | |-- App.java | | `-- DoMath.java | `-- test | `-- java | `-- main | |-- AppTest.java | `-- DoMathTest.java `-- target |-- classes | |-- DoMath.class | `-- main | `-- App.class |-- generated-sources | `-- annotations |-- generated-test-sources | `-- test-annotations |-- maven-status | `-- maven-compiler-plugin | |-- compile | | `-- default-compile | | |-- createdFiles.lst | | `-- inputFiles.lst | `-- testCompile | `-- default-testCompile | |-- createdFiles.lst | `-- inputFiles.lst |-- surefire-reports | |-- DoMathTest.txt | |-- TEST-DoMathTest.xml | |-- TEST-main.AppTest.xml | `-- main.AppTest.txt `-- test-classes |-- DoMathTest.class `-- main `-- AppTest.class 

Your application should be able to:--

  • Determine the filetype of what is passed in, and throw an error / exit if not a directory.

  • Print a tree of the file hierarchy of the supplied directory's subdirectories and files.

Bonus points: Colorize your output to distinguish between ordinary files and directories.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Introduction To Databases And Data Warehouses

Authors: Nenad Jukic, Susan Vrbsky, Svetlozar Nestorov

1st Edition

1943153191, 978-1943153190

More Books

Students also viewed these Databases questions

Question

6 Why is change considered a central aspect of HRM practice?

Answered: 1 week ago