I did something like the following in a bash terminal
( some_command ) >/dev/null 2>/dev/null
Yet I still got something printed. Here some_command runs a command-line program private to my organization. How did the sub-shell manage to print something to the console while I redirected both STDOUT and STDERR?
One possibility is that the program is particularly rude and is printing to the controlling terminal directly, which would circumvent all redirecting.
For example:
$ ( echo "can't touch this" > /dev/tty ) >/dev/null 2>/dev/null
can't touch this
(/dev/tty refers to the current process's controlling terminal.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With