My suggestion is to put a "uniq" on the end
Code:
--------------------
tc@PiTouch:~$ IP=$(netstat -nt 2>&1 | grep :3483 | grep ESTABLISHED | uniq -f
4 | awk '{ print $5 }' | grep :3483 | awk -F: '{ print $1 }')
tc@PiTouch:~$ echo $IP
192.168.2.140 192.168.2.140
tc@PiTouch:~$ netstat -nt 2>&1 | grep :3483 | grep ESTABLISHED | uniq -f 4 |
awk '{ print $5 }' | grep :3483 | awk -F: '{ print $1 }'
192.168.2.140
192.168.2.140
tc@PiTouch:~$ netstat -nt 2>&1 | grep :3483 | grep ESTABLISHED | uniq -f 4 |
awk '{ print $5 }' | grep :3483 | awk -F: '{ print $1 }' |
uniq
192.168.2.140
tc@PiTouch:~$ IP=$(netstat -nt 2>&1 | grep :3483 | grep ESTABLISHED | uniq -f
4 | awk '{ print $5 }' | grep :3483 | awk -F: '{ print $1 }' | uniq)
tc@PiTouch:~$ echo $IP
192.168.2.140
--------------------
Paul Webster
http://dabdig.blogspot.com
author of \"now playing\" plugins covering radio france (fip etc), kcrw,
supla finland, abc australia, cbc/radio-canada and rte ireland
------------------------------------------------------------------------
Paul Webster's Profile: http://forums.slimdevices.com/member.php?userid=105
View this thread: http://forums.slimdevices.com/showthread.php?t=112344
_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix