mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 06:28:58 +08:00
509d152e54
Completely fixes #1557 and the underlying Doxygen changes that caused it. Should make fish docs simpler and more robust, more consistent and generally prettier. todo: - trap unmarked text as arguments in context - test & fix sed portability - see in particular. (so far tested on BSD (Mac) and GNU sed). - test Makefile changes - last round of aesthetic changes and getting that ascii fish in there…
30 lines
1.1 KiB
Plaintext
30 lines
1.1 KiB
Plaintext
\section psub psub - perform process substitution
|
|
|
|
\subsection psub-synopsis Synopsis
|
|
\fish{synopsis}
|
|
COMMAND1 (COMMAND2 | psub [-f])
|
|
\endfish
|
|
|
|
\subsection psub-description Description
|
|
|
|
Posix shells feature a syntax that is a mix between command
|
|
substitution and piping, called process substitution. It is used to
|
|
send the output of a command into the calling command, much like
|
|
command substitution, but with the difference that the output is not
|
|
sent through commandline arguments but through a named pipe, with the
|
|
filename of the named pipe sent as an argument to the calling
|
|
program. `psub` combined with a
|
|
regular command substitution provides the same functionality.
|
|
|
|
If the `-f` or `--file` switch is given to `psub`, `psub` will use a
|
|
regular file instead of a named pipe to communicate with the calling
|
|
process. This will cause `psub` to be significantly slower when large
|
|
amounts of data are involved, but has the advantage that the reading
|
|
process can seek in the stream.
|
|
|
|
\subsection psub-example Example
|
|
|
|
\fish
|
|
diff (sort a.txt | psub) (sort b.txt | psub)
|
|
# shows the difference between the sorted versions of files `a.txt` and `b.txt`.
|
|
\endfish |