create a command line tool that takes in a directory, and prints all of its subdirectories in a formatted fashion

Closed Posted 3 years ago Paid on delivery
Closed Paid on delivery

In many command line interfaces, there is a command called tree that either already exists of 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

|-- [login to view URL]

|-- src

| |-- main

| | `-- java

| | `-- main

| | |-- [login to view URL]

| | `-- [login to view URL]

| `-- test

| `-- java

| `-- main

| |-- [login to view URL]

| `-- [login to view URL]

`-- target

|-- classes

| |-- [login to view URL]

| `-- main

| `-- [login to view URL]

|-- generated-sources

| `-- annotations

|-- generated-test-sources

| `-- test-annotations

|-- maven-status

| `-- maven-compiler-plugin

| |-- compile

| | `-- default-compile

| | |-- [login to view URL]

| | `-- [login to view URL]

| `-- testCompile

| `-- default-testCompile

| |-- [login to view URL]

| `-- [login to view URL]

|-- surefire-reports

| |-- [login to view URL]

| |-- [login to view URL]

| |-- [login to view URL]

| `-- [login to view URL]

`-- test-classes

|-- [login to view URL]

`-- main

`-- [login to view URL]

Submit a copy of your bash script's code via canvas. For now, just copy paste the code directly out of vim or nano (or use cat and print the code to the command line).

How to Submit

Try doing the program in chunks. Don't attempt to do everything in one sitting.

Start by drawing out what it is you think that the program should do.

In our notes, we've created a number of applications that extract information from grep and sed, split strings to act as arrays, and deal with file inputs.

Where to start:

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

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.

Your application should be able to:

UNIX Shell Script Bash Scripting

Project ID: #27426349

About the project

6 proposals Remote project Active 3 years ago

6 freelancers are bidding on average $36 for this job

aruaswin

Hi There!! I have 6+ Years of experience in Shell scripting in various flavours of Linux. I should be able to do this for you. Ping me we can talk and take this forward.

$20 USD in 1 day
(15 Reviews)
3.7
unixjon

Hello, I am an expert Linux administrator with a lot Shell scripting experience, I am sure that I can develop this tree view without problem

$111 USD in 3 days
(0 Reviews)
0.0
michalj97

Hi. I have 2 years of professional experience in bash scripting and using Unix based os. I created similar scripts already. Best regards. Michał

$20 USD in 5 days
(0 Reviews)
0.0