CS 2204 Lab 7
Your name here (please print):
Your student ID number here:
- (3 points) Understand what the command expr does. Then write a
bash script called interactive-product to read in two numbers, one at a time, and then print their product.
This script should work as follows:
[user@host name]$ ./interactive-product
Please enter the first number:
3
Please enter the second number:
7
The product is 21.
Write your script below.
- (3 points) Make three files in your home directory:
John.1, John.2 and John.3. Use "vim" to put
the name John Donn in the first one, John Smith in the second and Mary
Ann in the third. Now write a bash script that searches for
"John" in files John.k, where k goes from 1 to 5. Write it below.
- (4 points) Modify the last bash script from your lecture to print
the output line in bold white font on green background. You will find
the rainbow.sh useful. Write the appropriate echo command below.