[SunHELP] sort
Andrew Vendryes
sunhelp at sunhelp.org
Fri Jul 27 18:53:51 CDT 2001
Hello,
This should do it:
sort -n -t. -k 1,1 -k 2,2 -k 3,3 -k 4,4 foo.in > foo.out
Check the man page for more information on the switches. Also, since you
are asking this type of question I am going to throw this in while I am at it:
Never do something like this :
"sort foo > foo"
Because the first thing that sort does is to create the output file. In
this case, because the output file is also the input file, you will wind up
with a zero length input file and no data to sort.
--
Andrew
At 02:09 PM 2001-07-27 -0400, william.x.ng at verizon.com wrote:
>
>Does anyone know how to sort this
>146.13.10.30
>146.13.1.30
>146.13.11.30
>146.13.1.31
>146.13.1.4
>146.13.9.30
>148.13.1.30
>148.13.2.10
>
>to
>
>146.13.1.4
>146.13.1.30
>146.13.1.31
>146.13.9.30
>146.13.10.30
>146.13.11.30
>148.13.1.30
>148.13.2.10
>
--
Andrew Vendryes -- andrew at avdotnet.net
More information about the SunHELP
mailing list