Question: Write a Bash script named indexer. This script should take a path to a directory as a command line argument. If one is not provided

Write a Bash script named indexer. This script should take a path to a directory as a command line argument. If one is
not provided or the argument is not a valid directory, you should print an error message and exit. Otherwise, your program
should print nothing.
In each directory in the inputted directory recursively, including the inputted directory itself, you should create a file named
index.json. If one is already present, you should overwrite it. No other files should be created, deleted, or modified.
index.json should be a JSON file that contains lists of the regular files and directories in that directory, and a relative
path back to the inputted directory. Your code should work correctly even if any filenames have spaces.
Directories may contain a file named _special and/or a file named _blacklist. Both of these files, if present, will have a
single filename on each line. If a file is in a directorys _blacklist, it shouldnt be included in that directorys index.json.
If a file is in a directorys _special, the file should go into a different section of that directorys index.json. Neither the
_blacklist nor _special files themselves should be included in any index.json file lists

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!