Update cheatsheets

This commit is contained in:
ivuorinen
2025-03-23 00:20:07 +00:00
parent a49466c200
commit cd59a77dc8
31 changed files with 239 additions and 130 deletions

View File

@@ -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"`