mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-07 07:57:08 +00:00
Update cheatsheets
This commit is contained in:
@@ -28,6 +28,10 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`coproc {{name}} { while read line; do {{command1; command2; ...}}; done }`
|
||||
|
||||
- Create a coprocess which repeatedly reads `stdin`, runs a pipeline on the input, and writes the output to `stdout`:
|
||||
|
||||
`coproc {{name}} { while read line; do echo "$line" | {{command1 | command2 | ...}} | cat /dev/fd/0; done }`
|
||||
|
||||
- Create and use a coprocess running `bc`:
|
||||
|
||||
`coproc BC { bc --mathlib; }; echo "1/3" >&"${BC[1]}"; read output <&"${BC[0]}"; echo "$output"`
|
||||
|
||||
Reference in New Issue
Block a user