4 ms·
For me, AWK is mostly for one-liners, at which it excels...
by every 6y ago
For me, AWK is mostly for one-liners, at which it excels...
- m463 6y agoI generally use it in the same way. Anything greater than one line uses something else. To be honest, what I mostly use it for rearranging fields: something | awk '{print $1" "$2}' something | awk '{print "xyz:"$0}' something | awk '{print "cp "$3" "$4}' | sh what's a shame is how cut or other utilities make it unnecessarily bothersome to rearrange fields. I actually made a utility once called "words" that does: ls -l | words 1 3 4-5