I\'m writing a script to download a bunch of files, and I want it to inform when a particular file doesn\'t exist.
r=`wget -q www.someurl.com`
if [ $r -ne 0
$r is empty, and therefore your condition becomes if [ -ne 0 ] and it seems as if -ne is used as a unary operator. Try this instead:
wget -q www.someurl.com
if [ $? -ne 0 ]
...
EDIT As Andrew explained before me, backticks return standard output, while $? returns the exit code of the last operation.