Why would someone do this
(exec <&- >&- 2>&-; gzip somefile.txt) 2>&1 &
<&- >&- 2>&- "…means close stdin, stdout and stderr, respectively.."
but why do "2>&1" if it's closed?
io-redirection
Why would someone do this
(exec <&- >&- 2>&-; gzip somefile.txt) 2>&1 &
<&- >&- 2>&- "…means close stdin, stdout and stderr, respectively.."
but why do "2>&1" if it's closed?
Best Answer
The statement mentioned is incorrect because the standard file descriptors must be open.
POSIX specification: C.2.7 Redirection
The instruction would rather be