From dd12f55dc2fb1519afe9f887258c3303704c293b Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Thu, 19 Oct 2023 21:12:14 +0200 Subject: [PATCH] docs/read: Specify default scope Fixes #10061 --- doc_src/cmds/read.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc_src/cmds/read.rst b/doc_src/cmds/read.rst index b1723a788..3b97cf8d0 100644 --- a/doc_src/cmds/read.rst +++ b/doc_src/cmds/read.rst @@ -22,6 +22,8 @@ Unlike other shells, there is no default variable (such as :envvar:`REPLY`) for When ``read`` reaches the end-of-file (EOF) instead of the terminator, the exit status is set to 1. Otherwise, it is set to 0. +If ``read`` sets a variable and you don't specify a scope, it will use the same rules that :doc:`set` does - if the variable exists, it will use it (in the lowest scope). If it doesn't, it will use an unexported function-scoped variable. + The following options, like the corresponding ones in :doc:`set`, control variable scope or attributes: **-U** or **--universal**