Need to append ports to lists of ips via bash script.
Sample input:
ip="100.100.10.10,200.200.10.10,100.201.10.10"
port="123"
Expected output:
"100.100.10.10:123","200.200.10.10:123","100.201.10.10:123"
I got it to: "100.100.10.10","200.200.10.10","100.201.10.10"
using hosts="\"${ip//,/\",\"}\""
but can't get the ":$port" appended to each ip. Would prefer to append it in the same hosts= script rather than adding more script conditions.