4 ms·
A more idiomatic way to phrase the awk in the Selection example: awk -F ":" '{ if ( $3 != $4 ) print }' /etc/passwd would be like this: awk -F ":" '$
by minimax 15y ago
A more idiomatic way to phrase the awk in the Selection example:
awk -F ":" '{ if ( $3 != $4 ) print }' /etc/passwd
would be like this:
awk -F ":" '$3 != $4 { print }' /etc/passwd
The first is obviously valid awk, but the second highlights awk's unique "pattern { action }" syntax.
- malkomalko 15y agoI would argue the following below is a little nicer: awk -F':' '$3 != $4' /etc/passwd
- agumonkey 15y ago`pattern action` also idiomatic sed