- OPS435 -
OPEN SYSTEM AUTOMATION
Lab #10
FOCUS: awk utility - Continued...
PART A - Perform the following tasks:
- Logon to your Matrix account.
- Perform the week11 online tutorial called "Online Linux Tutorials". This tutorial must be completed to count as half of the mark for this lab #10. The tutorial, when properly completed will send your instructor and yourself an e-mail message to verify that the tutorial was completed.
Here is a link to the online tutorial instructions:
[ html ]
- Proceed to Part B
PART B - Perform the following tasks:
- Logon to your Matrix account. This lab requires that you use your
Matrix account in order to submit your lab.
- Make an empty directory, called lab10.
- Use the cd command to make lab10 your present working directory.
- Copy and paste the contents of each of following the links (name these files in your lab10 directory the same as the link names):
Here are the Links:
[ produce.txt ]
[ a1.txt ]
[ month_end.txt ]
- Examine the following awk statement and examine the produce.txt file. Predict the output that awk produces.
(Execute the statement to confirm your prediction).
awk '/^[A-M]/ && $3 < 1 {print $1,$3}' produce.txt
- Examine the following awk statement and examine the produce.txt file. Predict the output that awk produces.
(Execute the statement to confirm your prediction)
awk '/89/{print $1,$3 * $4}' produce.txt
-
Examine the following awk statement and examine the produce.txt file and the a1.txt file. Predict the output that awk produces.
(Execute the statement to confirm your prediction)
awk -f a1.txt produce.txt
-
Examine the following awk statement and examine the produce.txt file and the month_end.txt file. Predict the output that awk produces.
(Execute the statement to confirm your prediction)
awk -f month_end.txt produce.txt
- Proceed to Part C
PART C - Write a shell script
-
Using vi create a file called lab10.ans and answer the following 9 questions by creating the appropriate command that would accomplish the following (number the answers 1 through 9):
For example:
1. answer 1...
2. answer 2...
etc...
Here are the tasks:
- Display only the Name, Price and Quantity of each item in the db file.
- Display all items that cost between $0.50 and $2.15
- Display the name of all "Meat" products with a price of more than 2 dollars.
- Display the contents of the db file with the price of all taxable items discounted by 25%
- The Dairy industry has increased their price by 15%, show their products with the new price
- Lists all non-taxable items (by name) only and displays their price and their total worth (price X qty)
- Displays total worth of all non-taxable items
- Display the file with the total price, total quantity and total worth at the bottom
- Same as previous question but this time include a heading and display only the totals.
- Proceed to Part D to submit your lab...
PART D - Submit your Lab #10:
- Make certain that you are currently located in the lab10 directory
- Issue
the following Bash Shell script to check and if correct, send e-mail to
your OPS435 professor (works only for Murray Saul's sections):
/home/murray.saul/labs/submit-lab10.bash
This shell script should either indicate problems and hints for you
to correct your shell script, or indicate that your lab #10 submission
was successful. If your lab was successfully submitted, both
you and your OPS435 professor (Murray Saul) should have received an e-mail message.
Note: Keep this e-mail message for the remainder of the semester as
date and time stamp proof that you submitted the lab in case
there is a discrepancy with your OPS435 lab grade...