4 replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
source | link

I know how to redirect output and how to suppress themsuppress them in bash. Now, suppose I accidentally forgot to append the output redirection part to the command (e.g. 2>&1 or > /tmp/mystdout) and my background process is already running for a while, can I still change to where stdout and stderr are being written to? I really would like not to kill and restart the application.

To be more specific as asked by GillesGilles in his comment, I would like to fiddle with it in these scenarios in specific:

  • wrong output file
  • forgot to redirect stderr to stdout

or a combination of both

E.g. I have Apache running and I can see the file descriptors:

/proc/8019/fd/0 -> /dev/null
/proc/8019/fd/1 -> /dev/null
/proc/8019/fd/2 -> /var/log/apache2/error.log

I know how to redirect output and how to suppress them in bash. Now, suppose I accidentally forgot to append the output redirection part to the command (e.g. 2>&1 or > /tmp/mystdout) and my background process is already running for a while, can I still change to where stdout and stderr are being written to? I really would like not to kill and restart the application.

To be more specific as asked by Gilles in his comment, I would like to fiddle with it in these scenarios in specific:

  • wrong output file
  • forgot to redirect stderr to stdout

or a combination of both

E.g. I have Apache running and I can see the file descriptors:

/proc/8019/fd/0 -> /dev/null
/proc/8019/fd/1 -> /dev/null
/proc/8019/fd/2 -> /var/log/apache2/error.log

I know how to redirect output and how to suppress them in bash. Now, suppose I accidentally forgot to append the output redirection part to the command (e.g. 2>&1 or > /tmp/mystdout) and my background process is already running for a while, can I still change to where stdout and stderr are being written to? I really would like not to kill and restart the application.

To be more specific as asked by Gilles in his comment, I would like to fiddle with it in these scenarios in specific:

  • wrong output file
  • forgot to redirect stderr to stdout

or a combination of both

E.g. I have Apache running and I can see the file descriptors:

/proc/8019/fd/0 -> /dev/null
/proc/8019/fd/1 -> /dev/null
/proc/8019/fd/2 -> /var/log/apache2/error.log
3 added 6 characters in body
source | link

I know how to redirect output and how to suppress them in bash. Now, suppose I accidentally forgot to append the output redirection part to the command (e.g. 2>&1 or > /tmp/mystdout) and my background process is already running for a while, can I still change to where stdout and stderr are being written to? I really would like not to kill and restart the application.

To be more specific as asked by Gilles in his comment, I would like to fiddle with it in twothese scenarios in specific:

  • wrong output file
  • forgot to redirect stderr to stdout
  • combination of both

or a combination of both

E.g. I have Apache running and I can see the file descriptors:

/proc/8019/fd/0 -> /dev/null
/proc/8019/fd/1 -> /dev/null
/proc/8019/fd/2 -> /var/log/apache2/error.log

I know how to redirect output and how to suppress them in bash. Now, suppose I accidentally forgot to append the output redirection part to the command (e.g. 2>&1 or > /tmp/mystdout) and my background process is already running for a while, can I still change to where stdout and stderr are being written to? I really would like not to kill and restart the application.

To be more specific as asked by Gilles in his comment, I would like to fiddle with it in two scenarios in specific:

  • wrong output file
  • forgot to redirect stderr to stdout
  • combination of both

E.g. I have Apache running and I can see the file descriptors:

/proc/8019/fd/0 -> /dev/null
/proc/8019/fd/1 -> /dev/null
/proc/8019/fd/2 -> /var/log/apache2/error.log

I know how to redirect output and how to suppress them in bash. Now, suppose I accidentally forgot to append the output redirection part to the command (e.g. 2>&1 or > /tmp/mystdout) and my background process is already running for a while, can I still change to where stdout and stderr are being written to? I really would like not to kill and restart the application.

To be more specific as asked by Gilles in his comment, I would like to fiddle with it in these scenarios in specific:

  • wrong output file
  • forgot to redirect stderr to stdout

or a combination of both

E.g. I have Apache running and I can see the file descriptors:

/proc/8019/fd/0 -> /dev/null
/proc/8019/fd/1 -> /dev/null
/proc/8019/fd/2 -> /var/log/apache2/error.log
2 "be more specific" update as requested in Gilles' comment
source | link

I know how to redirect output and how to suppress them in bash. Now, suppose I accidentally forgot to append the output redirection part to the command (e.g. 2>&1 or > /tmp/mystdout) and my background process is already running for a while, can I still change to where stdout and stderr are being written to? I really would like not to kill and restart the application.

To be more specific as asked by Gilles in his comment, I would like to fiddle with it in two scenarios in specific:

  • wrong output file
  • forgot to redirect stderr to stdout
  • combination of both

E.g. I have Apache running and I can see the file descriptors:

/proc/8019/fd/0 -> /dev/null
/proc/8019/fd/1 -> /dev/null
/proc/8019/fd/2 -> /var/log/apache2/error.log

I know how to redirect output and how to suppress them in bash. Now, suppose I accidentally forgot to append the output redirection part to the command (e.g. 2>&1 or > /tmp/mystdout) and my background process is already running for a while, can I still change to where stdout and stderr are being written to? I really would like not to kill and restart the application.

I know how to redirect output and how to suppress them in bash. Now, suppose I accidentally forgot to append the output redirection part to the command (e.g. 2>&1 or > /tmp/mystdout) and my background process is already running for a while, can I still change to where stdout and stderr are being written to? I really would like not to kill and restart the application.

To be more specific as asked by Gilles in his comment, I would like to fiddle with it in two scenarios in specific:

  • wrong output file
  • forgot to redirect stderr to stdout
  • combination of both

E.g. I have Apache running and I can see the file descriptors:

/proc/8019/fd/0 -> /dev/null
/proc/8019/fd/1 -> /dev/null
/proc/8019/fd/2 -> /var/log/apache2/error.log
1
source | link