Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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 For Advanced Applications 9th International Conference Dasfaa 2004 Jeju Island Korea March 2004 Proceedings Lncs 2973

Authors: YoonJoon Lee ,Jianzhong Li ,Kyu-Young Whang

2004th Edition

3540210474, 978-3540210474

More Books

Students also viewed these Databases questions