For this Linux script, answer the questions following it:
# Sort lines 7 - 26 of the file
BEGIN {
idx = 1;
while (getline line<"makefile" ) {
data[idx] = line;
idx++;
}
for (idx2 = 7; idx2 <= 26; idx2++) {
data2[idx2 - 6] = data[idx2];
}
count = asort(data2);
for (idx3 = 1; idx3 < 7; idx3++) {
print data[idx3];
}
for (idx3 = 1; idx3 <= 20; idx3++) {
print data2[idx3];
}
for (idx3 = 27; idx3 < idx; idx3++) {
print data[idx3];
}
}
1) What variables are used by the script? If no variables are used then write "none"
2) How many pattern blocks, including the BEGIN and END blocks, are included in the script? If no blocks are used then write "none".
3) List the awk functions used in the script, and describe the purpose of each function. If no functions are used then write "none".
4) Are there any errors in the script? Does the script accomplish the task that was intended?
5) Are there any improvements that should be made to the script? What are they?
1) What variables are used by the script? If no variables are
used then write "none"
idx,count
2) How many pattern blocks, including the BEGIN and END blocks,
are included in the script? If no blocks are used then write
"none".
begin block is there no end , none
3) List the awk functions used in the script, and describe the
purpose of each function. If no functions are used then write
"none".
none
4) Are there any errors in the script? Does the script
accomplish the task that was intended?
yes see attachment , to perform this script successfully it need
full script as this has only 7-26 lines

5) Are there any improvements that should be made to the script?
What are they?
seems sorting the data to an array , from seeing this lines logic
seems ok
if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , thanks :)
For this Linux script, answer the questions following it: # Sort lines 7 - 26 of...
AWK Which answer best describes what this script does? 1 BEGIN { 2 MYVAR=0 3 } 4 { 5 OC[$1]++ 6 } 7 END { 8 for (C in OC) { 9 print C,OC[C] 10 } 11 } a. Does nothing; the array used on line 5 was never declared b. Prints a list of field 1 values and a count of how many times that value was encountered c. Does nothing; arrays must be indexed with an integer d....
Answer the following questions using linux 1) Write a Python script so that a file whoComesForDinner.txt formatted like this: Tuesday we have Joe McHungry and Paul McHungry Wednesday we have Cindy Johnston and Paul Paulsen Thursday we have Amin Mirzaei and Atefeh Mirzaei gets turned into that: The McHungry on Tuesday Cindy and Paul on Wednesday The Mirzaei on Thursday 2)Write a script that takes as argument a port number. It returns the next port that is not assigned to...
Hi, I need help for solving Linux question. . 1.Using the proper text editor, create a shell file called by (your name), your enrollment number, your program and the courses you study. Use the appropriate variables and display the above to the standard output (screen). . 2. Write A Shell Script to perform the following: Display the files and directories Print the date in 24 hour format Display the System id Display the current working directory Print the status of...
USING Unix/Linux shell !!!: 1) Write a script (project2.sh) that will take information from a file, and print (user’s choice of printers) identical form letters to each recipient. Either E197, E-199, E-194 printers or to project2.output. Prompt the user for their choice. 2) The script and output file are due: per Moodle timeline. Please upload your fully functioning script (project2.sh) your data file (project2.input) and your output file (project2.output) into Moodle. 3) Requirements of the script. a. You can use...
Please write a BASH Script in LINUX that... 1. is actually executable 2. has a comment to tell us what you did, why and how. 3. allows a user to enter their name and a number between 1 than 100 (this must be prompted so the user knows what to do) 4. creates a random number between 1 and 100 for you to guess. The command to create a random number is shown below. (if you find a better one...use...
A) Please implement a Python script to define a student class with the following attributes (instance attributes): cwid: student’s CWID first_name : student’s first name last_name: student’s last name gender: student’s gender gpa: student’s gpa Please make these attributes as private ones so they have to be accessed via getter/setter methods or property. For this purpose, please define a getter/setter method and property for each of the attributes. Another thing you need to do is to define a constructor that...
Answer the questions based on following information. 7. Describe the data collection method(s)' a. Who collected the data? b. What tools were used? c. What were the ethical considerations addressed and discuss gaps you identified. d. You will need to summarize and analyze the information from the article in your own words Method a quantitative, cross-sectional, descriptive design was chosen for this study. The instrument that was used to collect the data was a self-report questionnaire. a questionnaire previously used...
The current and voltage data are recorded below every 5 seconds for 1 minute (called a minute test): time = 5:5:60; current = (16 25 32 40 45 47 44 40 33 26 20 11]; voltage = [2 5 4.5 4.7 5.5 5.4 4.2 3.9 3.3 3 2.8 2.1); a) Write a script that uses cubic equation to model both the current and voltage data as a function of time. The script will plot both sets of data points and...
In Unix/Linux, input and output are treated as files and referenced by the operating system using file descriptors. When you open a shell session, for example, three file descriptors are in use: 0 standard input (stdin) 1 standard output (stdout) 2 standard error (stderr) By default, the command interpreter (shell) reads keyboard input from file descriptor 0 (stdin) and writes output to file descriptor 1 (stdout), which appears on the screen. As you explored in Lab 2, input/output can be...
Lesson Assignment There are 13 questions regarding slicing. The first 10 are required to pass. The last 3 are extra credit. You will place all your answers in the lesson.py tab. Select that tab and take a look at how it's done. For your answers, each function (already defined) returns a tuple: the first item is the answer using index notation (e.g. text[16:20]) the second item is the answer using slice notation (e.g. slice(16,20,None)) the numbers you use for the...