kotj.mf
01-13-2005, 03:50 PM
I need to output wget's stdout to a string in a shell script, eg:
mystring=`wget -nv --spider http://whatever`
...and do stuff based on what http status code I get.
Problem is, it keeps outputting to the console, and my string is empty.
Poking around, I've noticed that I can't even redirect it to a file.
wget -nv --spider http://whatever > file
gives stdout and an empty file.
I suppose I could output everything to a wget log file, but a) I'm planning on passing some variables to wget that I'd need to log, too, and b) it's ugly.
What am I missing here?
Thanks.
mystring=`wget -nv --spider http://whatever`
...and do stuff based on what http status code I get.
Problem is, it keeps outputting to the console, and my string is empty.
Poking around, I've noticed that I can't even redirect it to a file.
wget -nv --spider http://whatever > file
gives stdout and an empty file.
I suppose I could output everything to a wget log file, but a) I'm planning on passing some variables to wget that I'd need to log, too, and b) it's ugly.
What am I missing here?
Thanks.