aboutsummaryrefslogtreecommitdiffhomepage
path: root/init
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2005-10-15 20:12:45 +1000
committerGravatar axel <axel@liljencrantz.se>2005-10-15 20:12:45 +1000
commit4530ce8194a43e4098c6462073cee9c351a50f09 (patch)
treec577f3e23857f68506dfebc5422aa8082a7f6686 /init
parent43eb597b77c05c06f9847ed01de032f5c18789fc (diff)
Documentation updates
darcs-hash:20051015101245-ac50b-e49bdc40a0130ef1db42165919ab3e0a382121fe.gz
Diffstat (limited to 'init')
-rw-r--r--init/fish_function.fish9
1 files changed, 6 insertions, 3 deletions
diff --git a/init/fish_function.fish b/init/fish_function.fish
index aaa44565..70b163e4 100644
--- a/init/fish_function.fish
+++ b/init/fish_function.fish
@@ -717,7 +717,7 @@ function psub -d "Read from stdin into a file and output the filename. Remove th
echo psub: Not inside of command substitution
end
- # Find unique file name
+ # Find unique file name for writing output to
while true
set filename /tmp/.psub.(echo %self).(random);
if not test -e $filename
@@ -725,8 +725,12 @@ function psub -d "Read from stdin into a file and output the filename. Remove th
end
end
+ # Write output to file
cat >$filename
+ # Write filename to stdout
+ echo $filename
+
# Find unique function name
while true
set funcname __fish_psub_(random);
@@ -735,10 +739,9 @@ function psub -d "Read from stdin into a file and output the filename. Remove th
end
end
+ # Make sure we erase file when caller exits
eval function $funcname --on-job-exit caller\; rm $filename\; functions -e $funcname\; end
- echo $filename
-
end