Shell Script Catalog System
Code a set of shell scripts that writes and queries a file system containing an Catalog of items that you would like to search on a web site. The catalog needs to link through an association file: (ex: list of movie theaters and list of movies to search by movie name, movie genre, theater name or theater location) Submit this to moodle with the code and all the files inside one zip file.
Groups: This can be a group of up to 3 people. Everyone is responsible for knowing how every option is coded.
Details:
First, create 3 files, two that have numeric indexes and one that links the two files together. Each file needs 2 columns.
Make the following menu: (and I recommend using the shell "select" command for this menu.) The menu must repeat until exit is chosen. The system name is a parameter that will should print at the top of the page.
The search option needs to allow the user to find a word in one table and find all the related rows in the other table. The field that you are matching cannot exist in the second table, so you have to use the key to look up the association table. Recommendation: use grep to find matching rows and then sed to pick out the key. A list of keys can be used in grep with an -f option.
The add and remove option recommendations: use >> to append to a file to add, and use grep -v to remove lines. Remember to grep -v to a temporary file and then copy it back. Create temp files with the $$ appended to make it a unique name and remember to remove the file when you are done.
Sample Tables:
Movie Table
1,Mission: Impossible, Action
2,Fantastic Four, Action
3,The Gift, Drama
4,Vacation, Comedy
5,Ant-Man, Action
6,Minions, Family
7,Ricki and the Flash, Action
8,Trainwreck, Action
9,Pixels, Family
10,Southpaw, Action
Movie Theater Table
1,AMC Loews Stony Brook,(888)AMC-4FUN, 2196 Nesconset Highway, Stony Brook
2,Bellmore Movies, (516)783-7200,222 Petit Avenue, Bellmore
3.Bellmore Playhouse, (516)783-5440, 525 Bedford Avenue, Bellmore
4,Bow Tie Franklin Square Cinemas, (516)775-3257, 989 Hempstead Turnpike, Franklin
Square
Association Table (theater key followed by movie key)
1,1
1,2
1,3
2,1
2,4
2,9
2,10
3,1
3,3
4,1
4,3
Note: 1,2 means that Bellmore Movies is playing Fantastic Four