diff --git a/doc_src/doc.hdr b/doc_src/doc.hdr
index 2462c6534..21041a7b9 100644
--- a/doc_src/doc.hdr
+++ b/doc_src/doc.hdr
@@ -101,8 +101,8 @@ these characters, so called escape sequences are provided. These are:
- '\\^', escapes the circumflex character
- '\\xxx', where xx is a hexadecimal number, escapes the ascii character with the specified value
- '\\oooo', where ooo is an octal number, escapes the ascii character with the specified value
-- '\\uxxxx', where xxxx is a hexadecimal number, escapes the unicode character with the specified value
-- '\\Uxxxxxxxx', where xxxxxxxx is a hexadecimal number, escapes the unicode character with the specified value
+- '\\uxxxx', where xxxx is a hexadecimal number, escapes the 16-bit unicode character with the specified value
+- '\\Uxxxxxxxx', where xxxxxxxx is a hexadecimal number, escapes the 32-bit unicode character with the specified value
\subsection redirects IO redirection
@@ -111,10 +111,10 @@ a number called a file descriptor (FD). These are:
- Standard input, FD 0, for reading, defaults to reading from the keyboard.
- Standard output, FD 1, for writing, defaults to writing to the screen.
-- Standard error, FD 2, for writing, errors and warnings defaults to writing to the screen.
+- Standard error, FD 2, for writing errors and warnings, defaults to writing to the screen.
The reason for providing for two methods of output is so errors and
-warnings can be separated from program output.
+warnings can be separated from regular program output.
Any file descriptor can be directed to a different output than it's
default through a simple mechanism called a redirecton.
@@ -170,10 +170,10 @@ out more about the 'cat' program, type man cat.
Pipes usually connect file descriptor 1 (standard output) of the first
process to file descriptor 0 (standard input) of the second
process. It is possible use a different output file descriptor by
-prepending it to the pipe symbol, just like you would do with normal
-IO redirections. For example:
+prepending the desired FD number and then output redirect symbol to
+the pipe. For example:
-make fish 2|less
+make fish 2>|less
will attempt to build the fish program, and any errors will be shown
using the less pager.
@@ -590,48 +590,49 @@ actions which cannot be performed by a regular command.
The following commands are distributed with fish. Many of them are
builtins or shellscript functions, and can only be used inside fish.
-- ., to read and execute the commands in a file
-- bg, to set a command to the background
-- begin, to execute a block of commands
-- bind, to change keyboard bindings
-- break, to stop the execution of a loop
-- builtin, to execute a builtin command
-- case, to conditionally execute a block of commands
-- cd, to change the current directory
-- command, to execute an external program
-- commandline, to set or get the contents of the commandline buffer
-- complete, to add and remove completions
-- continue, to skip the rest of the current lap of a loop
-- count, to count the number of arguments
-- dirh, to view the directory history
-- dirs, to view the directory stack
-- end, to end a block of commands
-- else, to conditionally execute a block of commands
-- eval, to evaluate a string as a command
-- exec, to replace the current process image with a new command
+- ., read and execute the commands in a file
+- bg, set a command to the background
+- begin, execute a block of commands
+- bind, change keyboard bindings
+- break, stop the execution of a loop
+- builtin, execute a builtin command
+- case, conditionally execute a block of commands
+- cd, change the current directory
+- command, execute an external program
+- commandline, set or get the contents of the commandline buffer
+- complete, add and remove completions
+- continue, skip the rest of the current lap of a loop
+- count, count the number of arguments
+- dirh, view the directory history
+- dirs, view the directory stack
+- end, end a block of commands
+- else, conditionally execute a block of commands
+- eval, evaluate a string as a command
+- exec, replace the current process image with a new command
- exit, causes \c fish to quit
-- fg, to set a command to the foreground
+- fg, set a command to the foreground
- fishd, the universal variable daemon
-- for, to perform a block of commands once for every element in a list
-- function, to define a new function
-- functions, to print or erase functions
-- help, to show the fish documentation
-- if, to conditionally execute a block of commands
-- jobs, to print the currently running jobs
-- mimedb, to view mimedata about a file
-- nextd, to move forward in the directory history
+- for, perform a block of commands once for every element in a list
+- function, define a new function
+- functions, print or erase functions
+- help, show the fish documentation
+- if, conditionally execute a block of commands
+- jobs, print the currently running jobs
+- mimedb, view mimedata about a file
+- nextd, move forward in the directory history
- not, negates the exit status of any command
-- popd, to move to the topmost directory on the directory stack
-- prevd, to move backwards in the direcotry stack
-- pushd, to push the surrent directory onto the directory stack
-- random, to calculate a pseudo-random number
-- return, to return from a function
-- read, to read from a stream into an environment variable
-- set, to set environment variables
-- set_color, to change the terminal colors
-- switch, to conditionally execute a block of commands
-- tokenize, to split a string up into multiple tokens
-- while, to perform a block of commands while a condition is met
+- popd, move to the topmost directory on the directory stack
+- prevd, move backwards in the direcotry stack
+- pushd, push the surrent directory onto the directory stack
+- random, calculate a pseudo-random number
+- return, return from a function
+- read, read from a stream into an environment variable
+- set, set environment variables
+- set_color, change the terminal colors
+- switch, conditionally execute a block of commands
+- tokenize, split a string up into multiple tokens
+- ulimit, set or get the shells resurce usage limits
+- while, perform a block of commands while a condition is met
For more information about these commands, use the --help
option of the command to display a longer explanation.
diff --git a/init/fish_function.fish b/init/fish_function.fish
index aaa44565c..70b163e41 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