The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 07-16-2008
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,285
Code:
sort -t "." -k 1,1n -k 2,2n -k 3,3n -k 4,4n infile| sed -n '/10.10.2.3 /,/10.10.2.22/p'
Sorry, that's not good as you have to specify an existing start and end, ie. .3 and .22. I have no better idea atm, but I bet someone will come up with a better code soon.

Your code doesn't work because [1,22] is not a range in regular expressions. Afaik it would be written [1-22] but I don't get it working either