Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Write a bash script to help me organize all my books in 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):

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 contains 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.

(Here are links that explains the basics)

How to Create/Write a Simple/Sample Linux Shell/Bash Script : 5 Steps - Instructables

Writing a Simple Bash Script - Linux.com

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 Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

Explain the different types of marketing strategies.

Answered: 1 week ago

Question

Explain product positioning.

Answered: 1 week ago

Question

Explain Industrial market segment.

Answered: 1 week ago

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago