Can the regex matching pattern for awk be placed above the opening brace of the action line, or must it be on the same line?
问题 I'm studying awk pretty fiercely to write a git diffn implementation which will show line numbers for git diff , and I want confirmation on whether or not this Wikipedia page on awk is wrong [Update: I've now fixed this part of that Wikipedia page, but this is what it used to say]: (pattern) { print 3+2 print foobar(3) print foobar(variable) print sin(3-2) } Output may be sent to a file: (pattern) { print "expression" > "file name" } or through a pipe: (pattern) { print "expression" |