Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Bash programing language: Write a bash script to help me organize all my books on a computer. I want to enter a list of

Using Bash programing language:

Write a bash script to help me organize all my books on a computer. I want to enter a list of books with the following information:

Booktitle:

Author(s):

Publisher:

Year of publication:

Each item is to be kept in the file that will be simply called books. The script itself will be called bookinfo. This script will have one optional argument (an example of the command is given at the end). If it is a number, allow me to enter as many books as specified. If the argument is print, print the entire list of books to the file book_print. Print the books using the format I showed for entering data, but make sure that the file is formatted in columns.

Ill suggest organizing the books as one book per line, with different fields separated by the character .

Example of data in file (should be many lines of information formatted this way):

The Ultimate Hitchhikers Guide to the GalaxyDouglas AdamsDel Ray2002

Example of same entry in print (output of script):

Examples of the way to run it would be:

./bookinfo 3 george wind adventure (searches for each word individually and adds all matches)

./bookinfo -i the (search for all instances of and ignore case)

./bookinfo -i 2 parrot dog (search for all and all instances, ignoring case for both)

./bookinfo "multi word string" (search for all instances of 3 word sequence)

./bookinfo print (print all words to file)

The output of the matches would be one or more examples in the assignment, like:

Booktitle: The Ultimate Hitchhikers Guide to the Galaxy

Author(s): Douglas Adams

Publisher: Del Ray

Year of publication: 2002

Add an option to search for a pattern and print only the books that match the pattern. For example, the command

bookinfo -f "Douglas Adams" print

will only print the books that contain the pattern Douglas Adams anywhere in them. You should be able to handle regular expressions for search and ignore case if the option -i is specified. Submit a collection with at least ten books of your choice with the script. Specify any nice features you have added in a README file.

Example Book Titles & Authors:

Title: Romeo & Juliet

By: William Shakespeare

Title: To Kill a Mocking Bird

By: Harper Lee

Title: A Christmas Carol

By: Charles Dickens

Title: Of Mice and Men

By: John Steinbeck

Note:

(This project will have a file that contains the book information and the script that will be used to search that file. The script itself, is called in the format described, which will search that document based on the command line arguments given to it. As for the "./", if your current directory is in your path then you do not have to precede commands with that. If your current directory is not in your path, then you have to specify "./" before a command so the shell will look in your current location for that file. If you place your script somewhere in your path, then you would not need to do "./".)

(Please let me know if you need me to further update this question with any additional info to assist in your answering)

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

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions

Question

Define marketing.

Answered: 1 week ago

Question

What are the traditional marketing concepts? Explain.

Answered: 1 week ago

Question

Define Conventional Marketing.

Answered: 1 week ago

Question

Define Synchro Marketing.

Answered: 1 week ago

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago