Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.programmer Subject: Re: Can I get back stdout after redirection? Message-ID: <1991May1.045451.21516@athena.mit.edu> Date: 1 May 91 04:54:51 GMT References: <48186@ut-emx.uucp> Sender: news@athena.mit.edu (News system) Distribution: usa Organization: Massachusetts Institute of Technology Lines: 18 In article <48186@ut-emx.uucp>, pefv700@perv.pe.utexas.edu writes: |> Since the shell has already closed stdout's file descriptor, is it not |> possible to reopen it? You can't get back stdout per se. However, if stdout was pointing to your terminal before the shell closed it, you can open "/dev/tty" to get a file descriptor to write to the terminal. |> (Also, how did stdout get opened in the first |> place? The shell inherited it from its parent, didn't it?) Yes. -- Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710