Bird
0
0

In awk, what does the action block enclosed in curly braces { } specify?

easy📝 Conceptual Q1 of 15
Linux CLI - Text Processing
In awk, what does the action block enclosed in curly braces { } specify?
AThe pattern to match in the input
BThe file to read input from
CThe output file to write results to
DThe commands to execute when the pattern matches
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of patterns and actions in awk

    In awk, patterns select lines, and actions specify what to do with those lines.
  2. Step 2: Identify what the curly braces represent

    The curly braces contain the commands or actions executed when the pattern matches.
  3. Final Answer:

    The commands to execute when the pattern matches -> Option D
  4. Quick Check:

    Action block = commands executed [OK]
Quick Trick: Curly braces hold commands to run on matched lines [OK]
Common Mistakes:
  • Confusing pattern with action
  • Thinking curly braces specify input or output files

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes