Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This problem uses basic commands, documentation, file redirection - i.e. the bash shell), a Unix editor, the Unix file system using Unix filters (including Awk)

This problem uses basic commands, documentation, file redirection - i.e. the bash shell), a Unix editor, the Unix file system using Unix filters (including Awk) to solve text processing problems. Your task is to recurse through a subtree of the filesystem and put a file called dir.xml in each directory. You will pull data from 2 sources: the directory itself, and a file that may appear in each directory called README . You will write a script (or, scripts) that will take an optional argument, the directory to process. If not argument is supplied, use the current directory. In each subdirectory (including the top-level directory on which the script was called) you will place a file called dir.xml . If it already exists, simply overwrite it. Do not include it as one of the files listed. The root element will be direntry. It may contain up to 3 child nodes: index, required, and other. These three elements will contain text elements, either of type file or dir. Index and required data will be harvested from README (use AWK to parse this file). Other files will be found by taking a listing of the directory, looking for files or directories that weren't listed in README.

Sample Directory:

index.html Files/ Labs/ README labs.html 1/ README file1.1 file1.2 file1.3 index.html other4 other5 2/ Data/ README a b c README file2.1 file2.2 index.html other1 other4 other5 3/ README file3.1 file3.2 file3.3 file3.4 index.html other4 Lectures/ README lecs.html 

Example:

 version="1.0" encoding="ISO-8859-1"?>   index.html   file2.1 file2.2      Data  other1  other4  other5  README    

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 Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions