I have following line in my script, ${snap[@]} array contain my ssh server list.
while IFS= read -r con; do
ssh foo@"$con" /bin/bash <<- EOF
echo "Current server is $con"
EOF
done <<< "${snap[@]}"
I want to print current iteration value of the array as the ssh ran successfully, the $con should print current ssh server --> example@server. How would I do that ?