Question
4. Use the vi editor to create a script called hw2script and add commands from 4.1 to 4.10 into the script file: 4.1. A command
4. Use the vi editor to create a script called hw2script and add commands from 4.1 to 4.10 into the script file:
4.1. A command to display the contents of the customers file on the screen. Hints: Use the echo command to output a message or an empty line to make the output nice and readable.
4.2. A command to display the contents of the orders file on the screen.
4.3. A command to sort the customers file on the customer ID field and save the sorted result to a new file customers_sorted.
4.4. A command to sort the orders file on the customer ID field and save the sorted result to a new file orders_sorted.
4.5. Combine the customers_sorted and orders_sorted files based on the customer ID field and generate a file named customerOrders which has fields in the order of customer ID, first name, last name, email, order ID, order date, and order amount.
4.6. A command to output the contents of the customerOrders file on the screen.
4.7. A command to sort the file customerOrders in the ascending order of the order amount and output the result to a file named report.
4.8. A command to output the contents of the report file on the screen.
4.9. An awk command to output from the report file the customer ID, first name, last name, order date, and order amount in a neat format on the screen. Hints: Use format specifiers such as %-10s to format the output. See Chapter 4 Lecture Notes.
4.10. A command to output I certify that this submission is my own original work -- followed by your full name on the screen.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started