| Command | Beschreibung | Beispiel |
|---|---|---|
| print print $0 | ganze Zeile "as-is" (default block) | echo "a b c" | awk '{ print $0 }' ⇒ a b c |
| print $1 / print $2 / ... | xtes Wort (ohne quotes) pro Zeile | echo "foo text" | awk '{ print $2 }' ⇒ text |
| print "Text" $1 "Text" | 3 Werte werden concatiniert | echo "foo text" | awk '{ print "A" $1 "B" }' ⇒ AfooB |
| print "Text", $1, "Text" | 3 Werte werden mittels OFS concatiniert | echo "foo text" | awk '{ print "A", $1, "B" }' ⇒ A foo B (see OFS) |
| printf "format", Zahl/Formel | format "%.0f" ganzzahlig runden (ohne NL) | echo "123.789" | awk '{ printf "%.0f", $1 }' ⇒ 124 |
| printf "format", "Text" | format "%s" Text in format einsetzen (ohne NL) | echo "foo text" | awk '{ printf "%s is %s", $2, $1 }' ⇒ text is foo |