Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Purpose of This Assignment: Purpose of this assignment is to teach you about shell scripts with if structure. Write a shell script which performs the

Purpose of This Assignment:
Purpose of this assignment is to teach you about shell scripts with if
structure.
Write a shell script which performs the following tasks:
Your script should check whether the two files "names" and
"surnames" exist. If either one of them does not exist, your script
should abort with an appropriate error message.
Your script should check whether the number of lines in these files
are equal. You can use the "wc" command with appropriate
parameters to obtain the number of lines in a file.
Assume each line in file "names" contains a name, and each line in
"surnames" contains a surname. If the number of names and
surnames do not match; print which file has missing entries, and
how many. Then, if the number of names is greater than
surnames, print all names without a surname; otherwise print all
surnames which do not have a name. Print an appropriate
message if the number of lines in both files are equal.
Example:
Names
Ali
Ayse
Ipek
Veli
Output:
There are 2 missing surnames.
The names without a surname:
Ipek
Veli
Surnames
Atak
Tutak
SUBMISSION
Submit your .sh file as your assignment.
image text in transcribed

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

Nested Relations And Complex Objects In Databases Lncs 361

Authors: Serge Abiteboul ,Patrick C. Fischer ,Hans-Jorg Schek

1st Edition

3540511717, 978-3540511717

Students also viewed these Databases questions

Question

D How will your group react to this revelation?

Answered: 1 week ago