Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started