oIFS=$IFS;
IFS=$'\n';
for line in $(cat /proc/net/tcp6 |grep -v address);
do
IFS=$oIFS;
line=($line);
IFS=:
local_address=(${line[1]})
echo -n $((16#${local_address[0]:6:2})).\
$((16#${local_address[0]:4:2})).\
$((16#${local_address[0]:2:2})).\
$((16#${local_address[0]:0:2})):\
$((16#${local_address[1]}))
local_address=(${line[2]})
echo " <= " $((16#${local_address[0]:6:2})).\
$((16#${local_address[0]:4:2})).\
$((16#${local_address[0]:2:2})).\
$((16#${local_address[0]:0:2})):\
$((16#${local_address[1]}))
IFS=$'\n';
done;
IFS=$oIFS;
沒有留言:
張貼留言