Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

input.txt file aal aalii asterhood masterless masterlessness masterlike masterlily masterliness mathematicize mathematics mathematize mathemeg mathes mathesis mathetic Mathurin matico matildite matin matinal matinee mating matins

image text in transcribedinput.txt fileimage text in transcribed

aal aalii asterhood masterless masterlessness masterlike masterlily masterliness mathematicize mathematics mathematize mathemeg mathes mathesis mathetic Mathurin matico matildite matin matinal matinee mating matins matipo matka matless matlockite matlow matmaker matmaking matra matral Matralia Q1. Create a shell script in linux that execute the following list of commands repeatedly. You will need to use the for/while loop to allow repeated execution of the following shell commands. The user must be able to execute the shell script only once from a shell by typing the command /test.sh Sort outfile.txt & head-1000 OUT.txt & cp OUT.txt Final.txt & The shell script will perform the following operations. The first command in your shell script will read the file input.txt, sort the file and write the result back into the outfile.txt. The second shell command will reads the input.txt file and writes the first 1000 lines into OUT.txt. The third shell command will makes a copy of the OUT.txt file and store it in Final.txt. A smaple inputfile.txt is provided and posted under assessment 2 module. All output files will need to be created by the user. Tasks to be performed: You will be performing different execution tests: First, run the shell commands only one time, and observe the system status by issuing the ps command on a different terminal. Record the output of the experiment in term of the current active processes. Second, run the shell commands for 10 iterations and record your findings in terms of current active processes by issuing ps command. Third, run the shell commands for 100 iterations and record your findings in terms of current active processes by issuing the ps command. Fourth, run the shell command for infinite number of times and observed the system status by issuing the ps command. aal aalii asterhood masterless masterlessness masterlike masterlily masterliness mathematicize mathematics mathematize mathemeg mathes mathesis mathetic Mathurin matico matildite matin matinal matinee mating matins matipo matka matless matlockite matlow matmaker matmaking matra matral Matralia Q1. Create a shell script in linux that execute the following list of commands repeatedly. You will need to use the for/while loop to allow repeated execution of the following shell commands. The user must be able to execute the shell script only once from a shell by typing the command /test.sh Sort outfile.txt & head-1000 OUT.txt & cp OUT.txt Final.txt & The shell script will perform the following operations. The first command in your shell script will read the file input.txt, sort the file and write the result back into the outfile.txt. The second shell command will reads the input.txt file and writes the first 1000 lines into OUT.txt. The third shell command will makes a copy of the OUT.txt file and store it in Final.txt. A smaple inputfile.txt is provided and posted under assessment 2 module. All output files will need to be created by the user. Tasks to be performed: You will be performing different execution tests: First, run the shell commands only one time, and observe the system status by issuing the ps command on a different terminal. Record the output of the experiment in term of the current active processes. Second, run the shell commands for 10 iterations and record your findings in terms of current active processes by issuing ps command. Third, run the shell commands for 100 iterations and record your findings in terms of current active processes by issuing the ps command. Fourth, run the shell command for infinite number of times and observed the system status by issuing the ps command

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions