Johannes Altmanninger 0acbbfe2ca Document that a for-loop passes through any exit status
Unlike in other shells, for-loops do not set $status if
1. the loop count is zero, or if
2. the loop body consists of only commands like "set" that don't
   set $status.

POSIX for-loops always set an exit status (they set 0 if no loop
iterations). Following that would be awkward because it would add a
lot of complexity in combination with the 2 special cases above.

Document that "for" behaves the same as "set": it will pass through
existing $status, and also the last child's $status.

See the discussion in #8409
2021-11-18 15:06:12 +01:00
..
2021-09-09 15:13:17 +02:00
2021-11-04 15:21:28 +01:00
2020-04-04 10:44:53 +02:00
2021-07-23 18:00:57 +02:00
2021-02-02 08:35:38 +01:00
2020-03-21 15:31:25 +01:00
2020-04-04 10:44:53 +02:00
2020-04-04 10:44:53 +02:00
2020-03-21 15:31:25 +01:00
2021-08-10 21:01:39 +02:00
2021-08-09 17:42:00 +02:00
2021-05-04 13:21:46 -07:00
2020-09-10 20:48:13 +02:00
2021-09-23 17:12:37 +02:00
2021-11-14 13:40:02 -08:00
2020-04-13 22:56:22 +02:00
2021-04-14 21:46:51 +02:00
2021-05-04 13:50:09 -07:00
2021-08-04 21:09:47 +02:00
2021-08-04 21:09:47 +02:00
2020-03-22 15:53:09 +01:00
2020-03-21 15:31:25 +01:00