Question: Write a bash script that displays the number of courses a student is registered in. The program checks two files The first file NameID.txt which

Write a bash script that displays the number of courses a student is registered in. The program checks two files The first file NameID.txt which contains students ID and students names. The ID is a 6 digit decimal number, and the name could be on one of three formats.

First name last name

First name middle initial last name

First name middle name last name

Example

123456 John Doe 345678 John P. Doe 987654 JohnPublicDoe

Keep in mind that these three names are for three different students.

The second file NameCourse.txt is on the form Course number, Student Name

Example

EECS2021 John Doe EECS2021 John P. Doe EECS2031 John Doe EECS4201 John Doe

The program reads a student ID without any prompt, and then it displays the number of courses the student is registered in. If the student is not registered in any course displays 0 CPU % q21.sh 123456 3 CPU %

Where John Doe (with ID=123456) is registered in 3 courses

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!