Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 : Write a script called, script 4 _ 1 . sh that extracts the First Name, Last Name and Adjusted Score columns from

Question 1:
Write a script called, script4_1.sh that extracts the First Name, Last Name and Adjusted Score columns from files with similar formatting as rand_data.csv, do not assume that you will always be given this particular file as input. Sort the data numerically by Adjusted Score and print the top n scores, where is n is specified on the command line as $2 and the filename of the data file is $1.
The invocation of your script may look like the following:
./script4_1.sh rand_data.csv 3
Where for the above example, the top 3 scores are printed.
First Name,Last Name,Adjusted Score
YoYo,Rubics,90.21
Mariko,Sama,73.92
Nakajima,Rocky,71.38
Question 2:
You suspect a file has been modified, this file is called suspect.txt. You do not have a copy of original file, but you do have the file processed.txt, which was generated from the original unmodified file using a bash filters.
Write a script called script4_2.sh that has the inputs:
$1, the suspect file
$2, the processed file
You may only use the commands you've learned in class so far to solve this problem, so tools like grep, awk, sed cannot be used.
Your script will list the Student numbers that has modified letter grades. Only list each student number once to stdout.
An example invocation would be:
./script4_2.sh suspect.txt processed.txt
May have the output:
2367
2126
1111
The order of the student numbers do not matter.
Click here for a hint on how to compare files
Alternative hint
Question 3
Write a command called script4_3.sh that takes in 1 parameter $1, which represent the the parent ID. For the parent ID list all the process IDs of its children, and their invocation including the parameters to stdout. Kill all the child process of that parent, without killing the parent.
Example invocation:
./script4_3.sh 19155
May produce the following output:
19164,bash /tmp/test_script_1280.sh 10
19165,bash /tmp/test_script_1280.sh 21
19166,bash /tmp/test_script_1280.sh 22
19167,sleep 5h

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

OpenStack Trove

Authors: Amrith Kumar, Douglas Shelley

1st Edition

1484212215, 9781484212219

More Books

Students also viewed these Databases questions

Question

is particularly relevant to these questions.)

Answered: 1 week ago