Use named pipe for process substitution

darcs-hash:20051017141558-ac50b-08c8d1db664fc34bb2ab9e188184bd7172829eb5.gz
This commit is contained in:
axel 2005-10-18 00:15:58 +10:00
parent f87178420a
commit 1a5a49dcae

View file

@ -925,6 +925,7 @@ function psub -d "Read from stdin into a file and output the filename. Remove th
if not status --is-command-substitution
echo psub: Not inside of command substitution
return
end
# Find unique file name for writing output to
@ -935,8 +936,11 @@ function psub -d "Read from stdin into a file and output the filename. Remove th
end
end
# Write output to file
cat >$filename
# Write output to pipe. This needs to be done in the background so
# that the command substitution exits without needing to wait for
# all the commands to exit
mkfifo $filename
cat >$filename &
# Write filename to stdout
echo $filename