Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!uxc!uxc.cso.uiuc.edu!gistdev!flint From: flint@gistdev.UUCP Newsgroups: comp.unix.wizards Subject: Re: Unlinked temp files in sh scripts Message-ID: <8800013@gistdev> Date: 5 May 89 19:11:00 GMT References: <871@marvin.Solbourne.COM> Lines: 15 Nf-ID: #R:marvin.Solbourne.COM:871:gistdev:8800013:000:693 Nf-From: gistdev.UUCP!flint May 5 14:11:00 1989 If you are going to do this with the Korn shell, I think you're better off using a co-process, something like this: cat |& print -p "This stuff gets written to the co-process." read -p readup # Now ${readup} contains the stuff read back from the co-process. You can also redirect the input and/or output pipes of the co-process to a numbered file descriptor if you want, without having to have a temporary file sitting in the middle to clean up after. The other advantage is that the co-process can be a whole pipeline to filter the stuff you are running through it, as opposed to simply spitting back what it was given (as the cat above would do: any pipeline works in place of the cat.)