News for hackers. Stuff that matters.
Re:Understanding Awk by foobarian on Thursday September 30, 2021 @01:11PM (#28708639)
Exactly! Exactly! And now fix it to work with tabs :-)
Re:Understanding Awk by tyingq on Thursday September 30, 2021 @01:16PM (#28708700)
And leading whitespace. Compare:

  $ printf " one two  three"  | tr -s ' ' | cut -d ' ' -f 1

  $ printf " one two  three"  | awk '{print $1}'
  one
Re:Understanding Awk by goohle on Thursday September 30, 2021 @01:44PM (#28709000)

  ps ax | sed 's/^\s\+//; s/\s\+/ /g;' | cut -d ' ' -f 4
Re:Understanding Awk by goohle on Thursday September 30, 2021 @01:41PM (#28708965)

  echo -e '1\t2\t3\t4\t5' | expand -t 1 | cut -d ' ' -f 3