mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-02 05:41:16 -03:00
Use named pipe for process substitution
darcs-hash:20051017141558-ac50b-08c8d1db664fc34bb2ab9e188184bd7172829eb5.gz
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user