On Thu, Jan 18, 2018 at 6:55 PM, Divan Santana <[email protected]> wrote:
> Like a lot of GNU software parallel is awesome. Thanks. > How can I achieve the below equivalent in a better way? : > [cloud-ec.amp.cisco.com]='443 32137' It seems you can run: nc -w 2 -vz cloud-ec.amp.cisco.com 443 32137 So if you do not need to parallelize on the ports then doing this should be fine: mylist.txt: cloud-ec.amp.cisco.com 443 32137 console.amp.cisco.com 443 run_on_servers.txt: myserver1 myserver2 cat mylist.txt | parallel --slf run_on_servers.txt --onall eval nc -w 2 -vz The 'eval' is needed because GNU Parallel quotes arguments, so they are seen as a single argument even if they contain spaces. This is typically what you want if you pass it filenames with spaces or similar. However, today we really want the spaces in the input value split the input. 'eval' de-quotes one level. > Also, ideally I could use parallel to do the above test in parallel on > multiple hosts. The above should run all the test on all servers. /Ole
