sort di IPs

Davide D'Amico dave a gufi.org
Dom 27 Mar 2005 20:52:45 CEST


* Gianmarco Giovannelli <gmarco a giovannelli.it> [2005-03-27 15:46:31 +0200]:

dave a freebox:~> cat prova.txt
192.168.1.234
192.168.2.8
192.168.1.12
192.168.2.212
192.168.1.13
192.168.5.234
192.168.2.19
192.168.1.90
192.168.1.8

dave a freebox:~> cat prova.txt | awk -F '.' '{ printf ("%3d.%3d.%3d.%3d\n", $1, $2, $3, $4);};' | sort -n | awk -F '.' '{printf ("%d.%d.%d.%d\n", $1, $2, $3, $4);}'
dave a freebox:~> cat prova.txt | awk -F '.' '{ printf ("%d.%d.%d.%3d\n", $1, $2, $3, $4);};' | sort -n | awk -F '.' '{printf ("%d.%d.%d.%d\n", $1, $2, $3, $4);}'
192.168.1.8
192.168.1.12
192.168.1.13
192.168.1.90
192.168.1.234
192.168.2.8
192.168.2.19
192.168.2.212
192.168.5.234

dave

-- 
Davide D'Amico
Membro del G.U.F.I. (http://www.gufi.org)
Chiave pubblica su http://www.casadamico.net/files/dave.asc



Maggiori informazioni sulla lista varie