in reply to Re^5: how to supress stdout
in thread how to supress stdout

Yes, they are.

As for the assumption in "Assuming 1 is standard output ...", if fd's 1 & 2 have been already closed & opened to some other fd's (before redirection), would fd's 1 & 2 still work for the purpose (of redirection after being redirected)?

Replies are listed 'Best First'.
Re^7: how to supress stdout
by ikegami (Patriarch) on Dec 14, 2008 at 16:13 UTC

    I don't see why > would depend on the previous state of the file descriptors. If the fd is closed, > should reopen it.

    And that's what I see happening:

    $ ( echo foo ) 1>&- -bash: echo: write error: Bad file descriptor $ ( echo foo > /dev/tty ) 1>&- foo