Hacker News new | ask | show | jobs
by phcordner 2097 days ago
In the 6a. shell benchmark, what's the modern equivalent of the "+" option in sort from the below line?

  od sort.$$ | sort -n + 1 > od.$$
2 comments

-k POS

From the FreeBSD 2.1 man page [1]

  +POS1 [-POS2]
       Specify  a field within each line to use as a sort­
       ing key. The field consists of the portion of  the
       line starting at POS1 and up to (but not including)
       POS2 (or to the end of the  line if  POS2  is  not
       given). The  fields  and  character positions are
       numbered starting with 0.
[1] https://www.freebsd.org/cgi/man.cgi?query=sort&apropos=0&sek...
I think that +1 translates to -k 2. And, at least, FreeBSD's sort still supports +N.