Crawling filesystem directories and printing a tree

At this point, we already know about the commands locate, find, and grep (plus regular expressions), but what about if we wanted to create our own naive implementation of a directory crawler/scraper/indexer? It certainly won't be the fastest or have optimizations, but we can use recursive functionality and file tests to print a tree-like structure.

This exercise is a bit of a fun exercise and certainly recreates the proverbial "wheel". This can be easily done by running the tree command, however, this will be useful in an upcoming exercise when we'll be building arrays of arrays for files.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.249.154