mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-12 07:57:22 +00:00
00c6fcfe98
darcs-hash:20070115181924-ac50b-6ac48aec8937e9dd172858dfa7eaaac1aca14775.gz
26 lines
1.1 KiB
Text
26 lines
1.1 KiB
Text
\section psub psub - perform process substitution
|
|
|
|
\subsection psub-synopsis Synopsis
|
|
<tt>COMMAND1 (COMMAND2|psub [-f]) </tt>
|
|
|
|
\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. The psub shellscript function, which when combined with a
|
|
regular command substitution provides the same functionality.
|
|
|
|
If the \c -f or \c --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
|
|
|
|
<tt>diff (sort a.txt|psub) (sort b.txt|psub)</tt> shows the difference
|
|
between the sorted versions of files a.txt and b.txt.
|