This is what I have so far. I need helping parsing them together through pipes/
ID: 3717696 • Letter: T
Question
This is what I have so far. I need helping parsing them together through pipes/ input output I am also unsure of how to increase the value of the fruit pieces by + 0.02 as well.
-----------------------------
#!/bin/bash
date
whoami
sed 's/201./2018/g' orders
sed 's/apples/pears/g' orders
sort -k2 orders
sort -k3 -b customers
[help with Increase cost of fruits by 0.02]
awk '!($1="")' customers
paste orders customers >customersorders
Create a shell script which fulfills the following requirements Creating a Bash Script File After you are satisfied with your hands-on log session in Assigment 3-1(previous question) create and execute a bash script using a text editor of your choice that does the following Write a script called update that does the following: Lists current date Displays your username Updates year to 2018 for all line items in the orders file Changes apples to pears Sort fruits alphabetically (i.e. a-z) Sort customers by last name (i.e. A-Z) Increase cost of each fruit price by.02 Cut the number column from the customer file Combine the customers and orders into one file named resultExplanation / Answer
#!/bin/bash
date
whoami
# modify date ; modify apples to pear; sort by second key; increase price by 0.02
cat orders | sed 's/^201./2018/g' | sed 's/apples/pears/g' | sort -k2 | awk '{print $1, $2, $3 + 0.02}'> ordersTemp
# sort by third key date ; exclude first Column
cat customers | sort -k3 -b | cut -d " " -f2- > customersTemp
# merge 2 files
paste ordersTemp customersTemp >customersorders
#remove tempfiles
rm ordersTemp customersTemp
echo "Merged file is in customersorders "
echo "Content of customersorders is as below:"
cat customersorders
echo "Bye!!"
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.