I have a simple script that is used to run another program. This other program can sometimes give SIGSEGV , which violates my conclusion. So I added a couple of lines that should temporarily redirect stderr to /dev/null so that SIGSEGV ignored. Below is the code of my code:
exec 2> /dev/null progname >& ./tmp/run.txt && run_status='OK' exec 2>1
The problem is that the last line does not do what I want. Obviously, the first line works and redirects stderr . The last line should return stderr back to where it used to be (which I assumed is the same as stdout ).
Any help would be assigned!
source share