Hacker News new | ask | show | jobs
by cluckindan 311 days ago
How is that different from

    echo '999 888' | cut -f2 -d " "
except for the default delimiter being space for awk?
1 comments

   echo '999  888' | cut -f2 -d " " # notice two consecutive spaces
returns NULL.
There are invalid column separators for awk too. To handle consecutive spaces in cut you have squeeze them:

  echo '999  888' | tr -s " " | cut -f2 -d " "
Right, that would be expected though? I suppose awk is better for parsing formatted (padded) output.