mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-12 07:57:22 +00:00
Use named pipe for process substitution
darcs-hash:20051017141558-ac50b-08c8d1db664fc34bb2ab9e188184bd7172829eb5.gz
This commit is contained in:
parent
f87178420a
commit
1a5a49dcae
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue