[Toybox] cut is nuts.

Rob Landley rob at landley.net
Sun Sep 4 01:11:39 PDT 2016


I expected:

  $ echo abcdefghijklmnopqrstuvwxyz | cut -b 10-20,5-15
  jklmnopqrs efghijklmn
  $ echo one two three | cut -d " " -f 1,3,1
  one three one
  $ echo one two three | cut -d " " -f 3,2,1
  three two one

But what it's doing is:

  $ echo abcdefghijklmnopqrstuvwxyz | cut -b 10-20,5-15
  efghijklmnopqrst
  $ echo one two three | cut -d " " -f 1,3,1
  one three
  $ echo one two three | cut -d " " -f 3,2,1
  one two three

Sigh... so turning this into an awk replacement isn't as neat a fit as I
thought. Why is it doing any of this? Honestly couldn't tell you.
(Conservation of bytes?)

Rob



More information about the Toybox mailing list