Essay Questions
Construct detailed responses to the following prompts, synthesizing information from across the source document.
- Compare and contrast the two methods for installing GAWK on a GNU/Linux system as described in the source: using a package manager versus installing from source code. Discuss the steps and commands involved in each process.
- The source context describes a three-part structure for an AWK program (BEGIN, Body, END). Using examples from the text, explain the role of each part and how they work together to process a file like marks.txt.
- Discuss the concept of built-in variables in AWK. Select five different standard built-in variables (e.g., NR, NF, FS, FILENAME, ARGC), explain their function, and describe their utility with examples provided in the source.
- Explain AWK’s capabilities for handling regular expressions. Describe at least five different regular expression operators or special characters (e.g., ^, $, [], |, *) and provide an example for each based on the provided text.
- Detail the control flow and looping structures available in AWK. Describe the if-else statement, the for loop, and the while loop, providing the syntax and an example for each as shown in the source material.