Suppose I have a executable which for which I want to log STDOUT and STDERR to separate files, like so:
python write.py > out 2> err
When I use this command with GNU
out file is always empty. Why does this happen, and how can I fix this?
timeout 5s python write.py > out 2> err
#!/bin/bash import sys, time i = 0 while True: print i print >> sys.stderr, i time.sleep(1) i += 1