I'm looking for a way to redirect the output of a background process into /dev/null or some other file.
$ python ./spam_console.py &
$ [start doing something in the foreground
$ cat test.py
$ [whole console is spammed with output of python program]
I'm looking for a way to dump the stdout, stderr of these processes to some file using a simple command line utility.
$ dump_to -p 1526 --out /dev/null
There is an excellent solution at https://superuser.com/a/732504 using the gdb, but I'm looking for a way to wrap all these behind a simple alias/c program so that it can be used easily on command line. I'm looking for help in accessing gdb in non-interactive (aka programmatic) way to execute the command in the linked article.