home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / gnu / bash / bug / 546 < prev    next >
Encoding:
Text File  |  1992-08-12  |  1.4 KB  |  47 lines

  1. Newsgroups: gnu.bash.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!merlin.DEv.cdx.mot.COM!mcook
  3. From: mcook@merlin.DEv.cdx.mot.COM (Michael Cook)
  4. Subject: $() fails if stdin and stdout are not open
  5. Message-ID: <mcook.713640511@fendahl.dev.cdx.mot.com>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: Motorola Codex, Canton, Massachusetts
  8. Distribution: gnu
  9. Date: Wed, 12 Aug 1992 17:28:31 GMT
  10. Approved: bug-bash@prep.ai.mit.edu
  11. Lines: 34
  12.  
  13. If bash is run with stdin and stdout closed, the backquoting mechanism fails.
  14. Look:
  15.  
  16. bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty' >&- <&-
  17. foobaz
  18.  
  19. If either stdin or stdout is open, it works okay:
  20.  
  21. bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty'
  22. foobarbaz
  23. bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty'          <&-
  24. foobarbaz
  25. bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty'      >&-
  26. foobarbaz
  27. bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty'      >&- <&-
  28. foobaz
  29. bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty' 2>&-
  30. foobarbaz
  31. bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty' 2>&-     <&-
  32. foobarbaz
  33. bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty' 2>&- >&-
  34. foobarbaz
  35. bash$ bash -c 'echo foo$(echo bar)baz >/dev/tty' 2>&- >&- <&-
  36. foobaz
  37. bash$
  38.  
  39. (On our system (ULTRIX 4.2), when an X session is started, the $SHELL that is
  40. run to startup the window manager has stdin and stdout closed.  Lord only
  41. knows why...)
  42.  
  43. Bash should be made smart enough to handle this, shouldn't it?
  44.  
  45. Michael.
  46.  
  47.