News for hackers. Stuff that matters.
Re:Coreutils Gotchas (2015) by asicsp on Friday June 18, 2021 @11:13AM (#27551201)
>cut doesn't work with fields separated by arbitrary whitespace. It's often better to use awk

I was working on a script to provide cut like syntax using awk, mainly for awk's default field separation and regexp delimiters. It isn't ready, but I just created a repo with what I have so far: https://github.com/learnbyexample/regexp-cut

Re:Coreutils Gotchas (2015) by theiasson on Friday June 18, 2021 @01:21PM (#27552656)
Nice tool. I just found that if you have fields separated by arbitrary whitespaces, piping that through xargs trims multiple whitespaces into a single whitespace.

```$ echo "words are far apart" | xargs```

Although, it does have its caveats. https://stackoverflow.com/a/12973694

Re:Coreutils Gotchas (2015) by unhammer on Friday June 18, 2021 @02:28PM (#27553342)
>cut doesn't work with fields separated by arbitrary whitespace. It's often better to use awk

I use `cut` precisely when I want this behaviour. If something actually is tab-separated, I don't want `cut -f3` to give me the 4th column just because the value in column 1 was the empty string.