Shell Script Catalog System Step 1

This is step 1 of the project that will be due later: the full project description is here

Goal: 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.

What you will upload to moodle: a zip file of 4 files: the first data file, the second data file, the third data (linking) file, one script that has 2 search options. (If you prefer to make a different script for each of your search options, you can do that.) The scripts should have all group member names in comments (starting with #) so I know who to grade. Only one group member needs to submit.

Details:

First, create 3 files, two that have numeric indexes and one that links the two files together. Each file needs 2 columns.

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. Print the results using a read loop.

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 AMC Loewis playing Fantastic Four

Examples of other subjects:

Games and characters.

Games and stores that sell them.

Games and stats