Unlinked temp files in sh scripts

flint at gistdev.UUCP flint at gistdev.UUCP
Sat May 6 05:11:00 AEST 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.)



More information about the Comp.unix.wizards mailing list