Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

At the beginning of each program ( Bash script file ) , after the # ! / bin / bash line, there should be comments

At the beginning of each program (Bash script file), after the #!/bin/bash line, there should be comments with the authors name and the purpose of the script. If you don't include this information, up to 2 points will be subtracted from your score for each part of the project. [ Don't use awk Commands]
Write a Bash shell script named transform.sh. This script will be working with a data file named as the first argument to your script, so you would run it with the command:
./transform.sh fileNmae.csv
It is just sample data. You can add more data to this sample data. Your script should work for the following format data.
David Lee,(444)444-9998,$15.00,$55.00,$30.25
Sophia Smith,(555)999-1234,$20.50,$45.75,$28.00
Emily Johnson,(686)606-7890,$112.75,$60.25,$35.50
Michael Brown,(777)777-4321,$100.00,$510.00,$32.75
Sophia Davis,(828)883-9876,$25.50,$40.25,$27.30
Brian Wilson,(999)949-5678,$22.00,$48.50,$131.00
Olivia White,(111)111-2345,$17.25,$500.75,$29.75
Kevin Miller,(242)422-9990,$14.50,$57.00,$300.50
Sophia Taylor,(999)333-8765,$190.75,$47.25,$30.00
Andrew Martinez,(777)767-9876,$16.00,$53.50,$28.50
Hannah Lewis,(444)999-1111,$23.50,$42.75,$29.20
Robert Turner,(555)575-9999,$16.75,$54.25,$31.75
Sophia Walker,(666)666-2222,$21.00,$46.50,$28.80
Ethan Hall,(787)999-3333,$19.25,$48.75,$30.50
Ava Harris,(999)888-4444,$14.00,$57.50,$33.25
which indicates the amount someone expenses in three different categories: Expense1, Expense2, and Expense3.
Note that the actual file will contain other names, phone numbers, and amounts. You can assume that any names will have only a first and last name, with only alphabetic characters. I want your script to do the following tasks and save the resulting data in the locations asked.
1) Output the data to a new file, add a header to it, and send that data to a file called move1.txt.
This head should be as follows: Name Phone Number Expense1 Expense2 Expense3
2) Duplicate the file in a file called move2.txt, except replace any names of "Sophia" with "Sophi"
3) Put the list of persons (only their names, no other data) with area code 999 in a file called move3.txt
4) Anyone whose last names start with an A or H should go into a file called move4.txt, but only their first names.
5) Find the people who spend at least $50.00 in any category in the file move5.txt. I just want their full name and phone number, nothing else for this. This data should be sorted by their last name.
Nine points for each task finished. Note that you can do each of these tasks in more than one command if you like, but the result should be the files move1.txt - move5.txt
Note: These tasks do not have to be done in one single command. They can be done in a series of commands working on different files or piped from one command to another.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

c. What were you expected to do when you grew up?

Answered: 1 week ago

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago

Question

e. What do you know about your ethnic background?

Answered: 1 week ago