I have a program that outputs to stdout and would like to silence that output in a Bash script while piping to a file.
For example, running the program will output:<
Useful in scripts:
Get only the STDERR in a file, while hiding any STDOUT even if the program to hide isn't existing at all (does not ever hang parent script), this alone was working:
stty -echo && ./programMightNotExist 2> errors.log && stty echo
Detach completely and silence everything, even killing the parent script won't abort ./prog :
./prog /dev/null 2>&1 &