diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bash.html | 5 | ||||
-rw-r--r-- | tools/fish.html | 4 | ||||
-rw-r--r-- | tools/zsh.html | 7 |
3 files changed, 16 insertions, 0 deletions
diff --git a/tools/bash.html b/tools/bash.html index c4588f5..67caa6b 100644 --- a/tools/bash.html +++ b/tools/bash.html @@ -269,6 +269,11 @@ contains some nice visualization to explain bash redirections.</p> <li>duplicate <code>fd 1</code> to <code>fd 2</code>, effectively redirecting <code>stderr</code> to <code>stdout</code></li> <li>redirect <code>stdout</code> to <code>file</code></li> </ol> +<h2 id="process-substitution-ref"><a class="header" href="#process-substitution-ref">Process substitution (<a href="https://tldp.org/LDP/abs/html/process-sub.html">ref</a>)</a></h2> +<p>Process substitution allows to redirect the stdout of multiple processes at +once.</p> +<pre><code class="language-bash">vim -d <(grep foo bar) <(grep foo moose) +</code></pre> <h2 id="argument-parsing-with-getopts"><a class="header" href="#argument-parsing-with-getopts">Argument parsing with <code>getopts</code></a></h2> <p>The <code>getopts</code> builtin uses following global variables:</p> <ul> diff --git a/tools/fish.html b/tools/fish.html index a4d3695..0d3ad33 100644 --- a/tools/fish.html +++ b/tools/fish.html @@ -249,6 +249,10 @@ echo "ls output: "(ls) <pre><code class="language-sh"># 'noclobber', fail if 'log' already exists echo foo >? log </code></pre> +<h3 id="process-substitution"><a class="header" href="#process-substitution">Process substitution</a></h3> +<p>Redirect output of multiple processes. Same as <code><(..)</code> in bash.</p> +<pre><code class="language-sh">diff (sort a | psub) (sort b | psub) +</code></pre> <h2 id="control-flow"><a class="header" href="#control-flow">Control Flow</a></h2> <h3 id="if--else"><a class="header" href="#if--else"><code>if</code> / <code>else</code></a></h3> <pre><code class="language-sh">if grep foo bar diff --git a/tools/zsh.html b/tools/zsh.html index 4597a1b..fdcb06e 100644 --- a/tools/zsh.html +++ b/tools/zsh.html @@ -310,6 +310,13 @@ echo ${(kv)vec} # a aa b bb # Iterate over key value pairs. for k v in ${(kv)vec)}; do ...; done </code></pre> +<h2 id="io-redirections"><a class="header" href="#io-redirections">I/O redirections</a></h2> +<p>See <a href="bash.html#io-redirection">bash - I/O redirection</a></p> +<h2 id="process-substitution"><a class="header" href="#process-substitution">Process substitution</a></h2> +<p>Process substitution allows to redirect the stdout of multiple processes at +once.</p> +<pre><code class="language-bash">vim -d <(grep foo bar) <(grep foo moose) +</code></pre> <h2 id="argument-parsing-with-zparseopts"><a class="header" href="#argument-parsing-with-zparseopts">Argument parsing with <code>zparseopts</code></a></h2> <pre><code class="language-zsh">zparseopts [-D] [-E] [-A assoc] specs </code></pre> |