Ancient sort version?

Colin Watson cjwatson at ubuntu.com
Tue Aug 6 08:37:02 UTC 2013


On Mon, Aug 05, 2013 at 04:10:02PM -0500, Linda wrote:
> So where I do a system call in a c++ program of  sort -t^ +11 -10 +2
> -6 that actually is no longer the correct way to do it and I should
> start figuring out how to use -k instead?

That's the historical pre-POSIX notation.  I believe the equivalent
POSIX notation is:

  sort -t^ -k12,11 -k3,7

... except that I haven't tested that, and have no idea what it might
mean for POS1 (11) to be greater than POS2 (10) - is this real code or
just an example?

You might also consider using C++'s native sorting facilities rather
than forking an external process.

-- 
Colin Watson                                       [cjwatson at ubuntu.com]




More information about the ubuntu-users mailing list