home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: gnu.bash.bug
- Path: sparky!uunet!cis.ohio-state.edu!merlin.DEv.cdx.mot.COM!mcook
- From: mcook@merlin.DEv.cdx.mot.COM (Michael Cook)
- Subject: $() fails if stdin and stdout are not open
- Message-ID: <mcook.713640511@fendahl.dev.cdx.mot.com>
- Sender: gnulists@ai.mit.edu
- Organization: Motorola Codex, Canton, Massachusetts
- Distribution: gnu
- Date: Wed, 12 Aug 1992 17:28:31 GMT
- Approved: bug-bash@prep.ai.mit.edu
- Lines: 34
-
- If bash is run with stdin and stdout closed, the backquoting mechanism fails.
- Look:
-
- bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty' >&- <&-
- foobaz
-
- If either stdin or stdout is open, it works okay:
-
- bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty'
- foobarbaz
- bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty' <&-
- foobarbaz
- bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty' >&-
- foobarbaz
- bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty' >&- <&-
- foobaz
- bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty' 2>&-
- foobarbaz
- bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty' 2>&- <&-
- foobarbaz
- bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty' 2>&- >&-
- foobarbaz
- bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty' 2>&- >&- <&-
- foobaz
- bash$
-
- (On our system (ULTRIX 4.2), when an X session is started, the $SHELL that is
- run to startup the window manager has stdin and stdout closed. Lord only
- knows why...)
-
- Bash should be made smart enough to handle this, shouldn't it?
-
- Michael.
-
-