sort (gnu textutils) 2.0

Phil Wood <[email protected]> Wed, 30 Jul 2003 14:11:17 -0600
Newsgroups gmane.comp.gnu.textutils.bugs
Message-ID <E19hxI5-0001lT-00@cynosure>
OS: Linux

Question about +POS -POS vs -k

Given data in /tmp/list:

  10.165.114.153
  10.165.114.236
  10.165.114.82
  10.165.114.225
  10.165.115.131
  10.165.114.163

then:

  % sort -t\. -n +2 -3 +3 < /tmp/list
  10.165.114.82
  10.165.114.153
  10.165.114.163
  10.165.114.225
  10.165.114.236
  10.165.115.131
  
yields what I expect.

But,

  % sort -nt\. -k3,4 -k4 < /tmp/list
  10.165.114.153
  10.165.114.163
  10.165.114.225
  10.165.114.236
  10.165.114.82
  10.165.115.131
  
does not.

Is this just a fluke.  What is the correct way to sort these kinds of lists
correctly.

Thanks,

Phil