ACE-P-ALE1-04 practice question 12 of 35
What tool is awk based on?
Full set: 100 questionsawk was developed at Bell Labs as a more powerful and general text-processing tool, building upon the concepts of its predecessors, grep and sed. Both of these tools trace their direct lineage to ed, the original standard Unix line editor. grep originated from the ed command g/re/p (global/regular expression/print), and sed was designed as a non-interactive "stream editor" based on ed's scripting capabilities. Because awk generalizes the pattern-matching and action-taking paradigms established by ed and inherited by grep and sed, ed is considered the foundational tool upon which awk is based.
B. grep: While the creators of awk described it as a generalization of grep, grep itself is a specialized tool derived directly from the ed editor.
C. sed: awk shares concepts with sed, but sed is also a direct descendant of ed, making ed the more fundamental origin for both.
D. emacs: emacs is a powerful text editor that evolved from a different lineage (the TECO editor) and is not a direct ancestor of awk.
1. Kernighan, B. W., & Pike, R. (1984). The UNIX Programming Environment. Prentice-Hall.
Section 4.2, "Grep" (p. 103): "The grep command...gets its name from the ed command g/re/p, which prints all lines that match the regular expression re."
Section 4.3, "Sed" (p. 109): "The editor sed is a non-interactive version of ed." This establishes the direct lineage of grep and sed from ed.
2. Aho, A. V., Kernighan, B. W., & Weinberger, P. J. (1979). AWK — A Pattern Scanning and Processing Language (2nd ed.). Bell Laboratories, Murray Hill, New Jersey. (As published in UNIX Programmer’s Manual, Seventh Edition, Volume 2B).
Abstract: "It is a generalization of the UNIX program grep; it is not a generalization of the editor's substitute command, although it borrows syntax from the editor." This quote confirms awk's relationship to grep and its borrowing of syntax from the editor (ed), reinforcing ed's foundational role.
3. Dougherty, D., & Robbins, A. (1997). sed & awk (2nd ed.). O'Reilly & Associates.
Chapter 8, "The History of awk and sed": "The ed editor can be used to display lines in a file that match a particular pattern... Ken Thompson is credited with creating grep by taking the regular expression parser out of ed and building a standalone utility." This further solidifies the origin of grep from ed.
Keep practicing
Take the free ACE-P-ALE1-04 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other ACE-P-ALE1-04 practice questions
- Question 1When using the sudo command to run something as root, which password is required?
- Question 2Which utility can be used to remove sections or columns of each line of input?
- Question 3The ps –ef command is from which UNIX variant?
- Question 4In file globbing, which symbol matches any single character?
- Question 5If the system is swapping, what can be done to alleviate the problem?
- Question 6When scripting in bash, it is recommended to always use which symbols around your variabl…
