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
3
  • What is the value of $line when that happens? Dec 9, 2015 at 18:16
  • I dunno - how do I find out? suppose I can echo line head of the command?
    – Tony
    Dec 9, 2015 at 18:17
  • This might help: How to debug a bash script?
    – Cyrus
    Dec 10, 2015 at 4:01

0

You must log in to answer this question.

Browse other questions tagged .