diff --git a/pages/common/greater-than.md b/pages/common/greater-than.md index 4d345e7322..1c0552559d 100644 --- a/pages/common/greater-than.md +++ b/pages/common/greater-than.md @@ -26,3 +26,11 @@ - Redirect `stderr` to `stdout` for piping them together: `{{command1}} 2>&1 | {{command2}}` + +- Open a persistent file descriptor: + +`exec {{3}}>{{path/to/file}}` + +- Write to a custom file descriptor: + +`{{echo text}} >&{{3}}` diff --git a/pages/common/less-than.md b/pages/common/less-than.md index a844f33cea..09c070a47d 100644 --- a/pages/common/less-than.md +++ b/pages/common/less-than.md @@ -30,3 +30,7 @@ - Pass command output to a program as a file descriptor: `diff <({{command1}}) <({{command2}})` + +- Open a persistent file descriptor: + +`exec {{3}}<{{path/to/file}}`