Question: 1 . Write a Bash script called a 1 a . sh that prints every line of one file that contains a line of a

1. Write a Bash script called a1a.sh that prints every line of one file that contains a line of a second file. That is, $ ./a1a.sh file1 file2 will print every line of file2 containing a line of file1. As an example, suppose we have the input files $ cat foo a b bb b cc $ cat bar aa ab bc c $ cat baz ab cc ab Then the output would be $ a1a.sh foo bar aa ab bc $ a1a.sh bar foo cc $ a1a.sh foo baz ab cc ab
2. Write a Bash script called a1b.sh that prints every line of one file that is not contained in a second file. That is, $ ./a1b.sh file1 file2 will print every line of file1 that is not in file2. Using the same input files as above, $ a1b.sh foo bar bb cc $ a1b.sh bar foo aa ab bc $ a1b.sh baz foo ab ab 2

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 Programming Questions!