Multiple choice technology operating systems

What is Output - awk 'BEGIN { if (length($0) > max) max= length($0) } | END { print max }' test.txt

  1. Will print the longest line

  2. Will display all the content of the file

  3. Print the count of the first line of the file.

  4. Will give the count of the longest line

Reveal answer Fill a bubble to check yourself
D Correct answer
AI explanation

The script tracks the length of each line read and keeps the maximum value seen in the variable max, then the END block prints that final value once the whole file has been processed. So the output is a single number representing how many characters are in the longest line, not the line's text itself. This distinguishes it from simply printing the longest line's content.