Monday, February 8, 2016

linux command to get urls response from email json file

# insert new line after '},'
sed -i $'s/},/\\\n/g' file

# extract email value from json
grep -o '"email":"[^,]*' file

# do GET on urls and print response code
cat urls.txt | xargs curl -sL -w " %{http_code} %{url_effective}\\n" -o