Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write an awk script list_sizes.awk that prints the size of every element in the free list, in order, after each Free or Alloc operation. Your

write an awk script list_sizes.awk that prints the size of every element in the free list, in order, after each Free or Alloc operation. Your program should act like this:

$ awk -f list_sizes.awk malloc-out.txt | head

99

1 99

1 92

1 7 92

1 2 92

1 2 84

1 2 8 84

1 5 2 8 84

5 2 8 84

2 8 84

Hint: you can use printf and loops in awk programs. In both cases the syntax is similar to C. Here is an example of an awk program with a loop:

{ n = $1

for (i=0; i < n; i++) {

printf(%s , $(2+i))

}

}

This program assigns the value in field 1 to variable n, then prints fields 2, 3, 4 up to field 2 + n - 1.

I can provide malloc-out.txt if needed!!!!!!

malloc-out.txt:

https://drive.google.com/file/d/17WMZ9mwG_Wr2YtOwdnFfLo9gGBLHM6HL/view

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

Oracle 11G SQL

Authors: Joan Casteel

2nd Edition

1133947360, 978-1133947363

More Books

Students also viewed these Databases questions

Question

=+j Explain the relationship between unions and MNEs.

Answered: 1 week ago

Question

=+Have they changed the way employees view IP?

Answered: 1 week ago