Re:Understanding Awk
by goohle on Thursday September 30, 2021 @12:48PM
(#28708382)
[ Parent
| on HN ]
Exactly! Exactly! And now fix it to work with tabs :-)
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