[Durham] another sort question - numbers in slashes

Dougie Nisbet dougie at highmoor.co.uk
Tue Nov 5 15:28:52 UTC 2013


I have a file in the format:

switchname  switchport  ipaddress stuff

and I'd like to sort it.

This is almost ok but I'm having problems with the switch bit, which is the
format:

num1/num2/num3

num3 can be from 1 to 24.

A normal sort works fine except that the output can contain this sort of
thing:

switch1  1/0/1  192.etc etc etc etc
switch1  1/0/2  192.etc etc etc etc
switch1  1/0/2  192.etc etc etc etc
switch1  1/0/12  192.etc etc etc etc
switch1  1/0/18  192.etc etc etc etc
switch1  1/0/4  192.etc etc etc etc
switch1  1/0/5  192.etc etc etc etc

I can't work out how to sort on the switchname and numerically sort on the
switchport. I don't know what I'm missing, but I'm missing it, whatever it
is.

Dougie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/durham/attachments/20131105/29bb23e5/attachment.html>


More information about the Durham mailing list