1

This code seems to ouput a http status of 000 - which seems to indicate something didn't connect properly but when I do this curl outside of the bash script it works fine and produces a 200 so something with this code is off... any guidance?

#!/bin/bash

URLs=$(cat test.txt | grep Url | awk -F\  ' { print $2 } ')
# printf "Preparing to check $URLs \n"
for line in $URLs
    do curl  -L -s -w "%{http_code} %{url_effective}\\n" $line
done
  • What is the value of $line when that happens? – glenn jackman Dec 9 '15 at 18:16
  • I dunno - how do I find out? suppose I can echo line head of the command? – Tony Dec 9 '15 at 18:17
  • This might help: How to debug a bash script? – Cyrus Dec 10 '15 at 4:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.