A estrutura da execução awk
é: pattern { action statements }
Actions
Action statements are enclosed in braces, { and }. Action statements consist of the usual assignment, conditional, and looping statements found in most languages. The operators, control statements, and input/output statements available are patterned after those in C.
-
print
é a declaração de E / S deawk
.Da página de manual:
print Print the current record. The output record is terminated with the value of ORS.
-
Visite o manual > A declaração de impressão :
The print Statement
Use the print statement to produce output with simple, standardized formatting. You specify only the strings or numbers to print, in a list separated by commas. They are output, separated by single spaces, followed by a newline. The statement looks like this:
print item1, item2, …
Visite man awk
para mais detalhes.
Observe também que:
PATTERNS AND ACTIONS
AWK is a line-oriented language. The pattern comes first, and then the action. Action statements are
enclosed in { and }. Either the pattern may be missing, or the action may be missing, but, of course, not
both. If the pattern is missing, the action is executed for every single record of input. A missing action
is equivalent to
{ print }
which prints the entire record.
awk
não tem echo
keyword / statement.
$ man awk | grep echo | wc -l
0