I need to get all running ports from the server, like the unix command 'netstat -an | grep tcp46'
OUTPUT:
tcp46 0 0 *.8009 *.* LISTEN
tcp46 0 0 *.8080 *.* LISTEN
Then I need to iterate the ports and form a command like below.
curl http://serverhost.com:${iterative ports}/app/version
eg.
Can anyone please help me with the shell script or any easy commands available?