subject

Write an awk script named extract. awk to extract a portion of the input file(s) as follows. somewhere after a line containing exactly the text "start from here", find the first line containing exactly the text "nextline" and display the following line. no other lines should be displayed. if the specific lines are not present, then the script should display nothing. for example: [user]$ cat test0.txt
start from here
nextline
this is the one we want
not this one.
nor this one.
[user]$ extract. awk test0.txt
this is the one we want
[user]$ cat test1.txt
ignore everything up here
nextline
ignore these lines also because we
did not see the first magic line yet.
start from here
more lines to ignore
nextline
this should be displayed
this should not
nextline
this is too late so do not display it
start from here
only the first occurrence matters so
nextline
none of this will be displayed either
[user]$ extract. awk test1.txt
this should be displayed
[user]$ cat test2.txt
1
this file has no magic text
anywhere!
[user]$ extract. awk test2.txt
[user]$

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:50
Consider a slotted aloha system, where the time slot equals the fixed duration of each packet. assume that there are 4 stations a,b,c,d sharing the medium. (a) stations a,b,c,d receive one packet each from higher layers at times 1.3, 1.5, 2.6,5.7 respectively. show which transmissions take place when, according to the slottedaloha protocol; describe all transmissions until all four packets have been successful.when needed, each station has access to the following sequence of random number, provided by a random number generator and drawn uniformly between 0 and 1: (1) station a draws numbers: 0.31, 0.27, 0.78, 0.9, 0.9, 0.11, 0. (2) station b draws numbers: 0.45, 0.28, 0.11, 0.83, 0.37, 0.22, 0. (3)station c draws numbers: 0.1, 0.2, 0.3, 0.4, 0. (4) station d draws numbers: 0.36, 0.77, 0.9, 0.1, 0.1, 0.1, 0.1, 0. (b) in slotted aloha, a station transmits in each time slot with a given probability. what probabilities would you assign to each of the four stations so as to: (i) maximize the efficiency of the protocol? (ii) maximize fairness among the four stations? (c) will the efficiency increase or decrease if we modify slotted aloha as follows: (i) get rid of slots and allow stations to transmit immediately? (ii) implement carrier sensing? (iii) implement collision detection? (iv) implement collision avoidance?
Answers: 3
question
Computers and Technology, 23.06.2019 10:30
How would you categorize the software that runs on mobile devices? break down these apps into at least three basic categories and give an example of each.
Answers: 1
question
Computers and Technology, 23.06.2019 11:30
In cell h5 enter a formula that will calculate the percentage of attendees that went to the altamonte springs job fair in 2018.
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
Examine the list below. which factors positively affect lifetime income? check all that apply.
Answers: 1
You know the right answer?
Write an awk script named extract. awk to extract a portion of the input file(s) as follows. somewhe...
Questions
question
History, 20.01.2021 19:40
question
Biology, 20.01.2021 19:40
question
Mathematics, 20.01.2021 19:40
question
Mathematics, 20.01.2021 19:40
question
Mathematics, 20.01.2021 19:40
question
Mathematics, 20.01.2021 19:40
Questions on the website: 13722360