Question: uestion 1 [ 6 Points ] A data file named fruits.txt contains the following entries in the format < uantity > : Mango A 1
uestion Points
A data file named fruits.txt contains the following entries in the format
uantity: Mango A
Orange C
Banana B
Apple E
Kiwi C
Guava C
Papaya A
Avocado K
Write a shell program named info.sh that takes in or arguments from the user and based on them performs the following tasks:
For arguments, display the fruit name and total price Price X uantity in each line
For argument,
o If the argument is a single character, print all the fruits from fruits.txt that contain that vitamin followed by their total price in new line Find total price of each fruit then sum up for all the included fruits
o If argument is a number, print all fruits whose Unit Price not total price is less than or equal to it
o Else argument is a string print the Vitamin and Unit Price of the fruit whose name matches with the argument even if case doesn't match
For or more arguments print an error message Example:
Input: info.sh C Output: Orange
Kiwi Guava
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
