Here's what I've attempted:
$var=$(wget --spider -S "http://www.test.com/images/$image" 2>&1 | grep "HTTP/" | awk '{print $2}')
if [ $var -eq 200 ]; then
echo "$image|found" >> foundimages.txt
fi
I need the result dropped into var
and I need to compare it. This attempt fails to store that command result. Any ideas?