I have created an array uisng the command IFS=\', \' read -r -a array <<< \"$(command)\"
IFS=\', \' read -r -a array <<< \"$(command)\"
The array has values:
abc001 abc002 abc003
#!/bin/bash for element in "${array[@]}"; do if curl -m1 -s "http://$element:8888"; then echo "'$element' connected" && break fi done