Re:Understanding Awk
by foobarian on Thursday September 30, 2021 @01:11PM
(#28708639)
Exactly! Exactly! And now fix it to work with tabs :-)
[ Parent
| on HN ]
And leading whitespace. Compare:
$ printf " one two three" | tr -s ' ' | cut -d ' ' -f 1
$ printf " one two three" | awk '{print $1}'
one ps ax | sed 's/^\s\+//; s/\s\+/ /g;' | cut -d ' ' -f 4