From 833e0d84fb0851fe779e416ea17decc7ba00322e Mon Sep 17 00:00:00 2001 From: Managor <42655600+Managor@users.noreply.github.com> Date: Tue, 26 Aug 2025 05:17:14 +0300 Subject: [PATCH] {greater, less}-than: add persistent file descriptor example (#17773) * Update less-than.md and greater-than.md --- pages/common/greater-than.md | 8 ++++++++ pages/common/less-than.md | 4 ++++ 2 files changed, 12 insertions(+) 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}}`