I have a script that uses subprocesses to fetch HTML:
misha@misha-K42Jr:~/git/domain_classifier$ python webkit_retrieve.py error-cut.txt html/error -N 5
http://kurabo.co.jp HostNotFoundError
http://monarch.com HostNotFoundError
http://nssmgmt.com HostNotFoundError
http://sbcglobal.net HostNotFoundError
http://dynamixcorp.com SslHandshakeFailedError
http://groupe-synox.com RemoteHostClosedError
QFont::setPixelSize: Pixel size <= 0 (0)
http://www.cnn.com NoError
http://pacbell.net TimeoutError
If I run the same script, but redirect output to a file, I get nothing in the output:
misha@misha-K42Jr:~/git/domain_classifier$ python webkit_retrieve.py error-cut.txt html/error -N 5 > stdout.txt
QFont::setPixelSize: Pixel size <= 0 (0)
misha@misha-K42Jr:~/git/domain_classifier$ cat stdout.txt
misha@misha-K42Jr:~/git/domain_classifier$
Why is the output empty? Should it not contain the same things that were printed to stdout in the first case?
use &>
for redirection, this should redirect stdout
and stderr
to designated file