Wget exit code for each line in file

I am trying to validate links inside file if its up or not.

Heres what I am trying :

#!/bin/bash
link='cat url'
get=$(wget -q "$link") 
if [ "$get" -ne 0 ]
  then echo "Link not up"
  else echo "OK"
fi
$ ./validate
./validate: line 4: [: : integer expression expected
OK
$ 

Please suggest ..

Thanks,
Sriram

wget -q returns nothing to STDOUT...
You probably want to check it's return value:

while read url; do
  wget -q "$url"
  if [ $? -ne 0 ]; then
    echo "Link not up"
  else
    echo "OK"
  fi
done < url

Thanks a ton sulti ....