I have some sort of multi-agent system running locally implemented in Python using ZeroMQ. The master is started as the main thread (python Admin.py
) and this one starts the worker agents as multiprocessing.Process
sub-processes.
Both the Admin.py and the workers write output using simple print
commands. Now I try to fetch all output that I see on my console: $ python Admin.py > file.txt
. But this statement only fetches the output written by the Admin.py. I tried various redirects such as piping sterr into stdout and than fetches stdout (1>&2 > file.txt
) but without any result. This question has been asked in various forms on Satckoverflow (here and here) and the answers seem to involve quite some additional python coding. Is there a Bash solution to this issue? I see all output on my console, so why can't Bash redirect it to a file?