[Toybox] Has anybody ever actually used cut -f?

Rob Landley rob at landley.net
Thu Sep 1 12:58:55 PDT 2016


In theory:

  echo "one two three four five" | cut -f 2-4

Should be really useful, and mean you don't need awk. In practice, posix
specifies that the default separator of cut -f is TAB, and that the -d
delimiter specifier has no way to specify 'arbitrary run of whitespace'.

So I propose 2 changes to toybox cut:

1) -d "" means arbitrary run of whitespace.

2) It's the default.

As has been noted before, this makes about 90% of the uses of awk go
away. The downside is, if you're _not_ using toybox cut, it won't work.

Any opinions?

Rob



More information about the Toybox mailing list