I want to read a file of urls, curl each url and only get the first line which contains the HTTP code. I am running under Windows 10 inside Cmder.
#!/bin/bash
input="urls.csv"
truncate -s 0 dest.csv
while IFS= read -r var
do
result= `curl -I ${var%$'\r'} | grep HTTP $result`
echo "$var $result" >> dest.csv
done < "$input"
however the output file is empty, thank you