X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=ips;h=031cf0b42a93d46a34c903f71a0796b569e512db;hb=dd6776bd8fdbe5e15f2c8928b397512ef15c8f61;hp=f23c43f2d1db241495889a78312d6c553c243443;hpb=ca1007d877fa58d93e1e4adb42c5b1219407ba09;p=dell-switch diff --git a/ips b/ips index f23c43f..031cf0b 100755 --- a/ips +++ b/ips @@ -1 +1,4 @@ -ls log/*.log | cut -d/ -f2 | cut -d_ -f1 | sed 's/\./ /g' | sort -n -k 4 | sed 's/ /./g' +COLS=1 +test ! -z "$1" && COLS=$1 +test "`basename $0`" == "hosts" && COLS=1,2 +ls log/*.log | cut -d/ -f2 | cut -d_ -f$COLS | sed 's/\./ /g' | sort -n -k 4 -u | sed -e 's/ /./g' -e 's/_/ /g'