I'm new to bash scripting and I keep getting "could not resolve host" when running the following script. I know it must be a slash or comma, but I have tried everything and can't figure it out. I've shortened the number of site for this example. Thanks in advance for any clues!
1 #!/bin/bash
2
3 sites="https://www.example.com/comm/swift-lines/2012-advocate.html,
4 "
5 for site in ${sites//, }
6 do
7 #code='curl -I -L -k -s -o /dev/null -w "%{http_code}" "http://${site}"'
8
9 code=`curl -I -w "%{http_code}" "http://${site}"`
10 echo "${site} ${code}"
11 done