[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ${| command; } funsub not setting REPLY does not error out with 'set
From: |
Lawrence Velázquez |
Subject: |
Re: ${| command; } funsub not setting REPLY does not error out with 'set -u' active |
Date: |
Wed, 18 Dec 2024 22:11:14 -0500 |
On Wed, Dec 18, 2024, at 9:39 PM, Zachary Santer wrote:
> $ set -u
> $ unset REPLY
> $ printf '%s\n' "${REPLY}"
> bash: REPLY: unbound variable
> $ printf '%s\n' "${| :; }"
>
> $ printf '%s\n' "${| unset REPLY; }"
FWIW, this agrees with mksh R59 2020/10/31 but not zsh master.
(I'll be raising the issue on zsh-workers@zsh.org shortly, to
verify whether the behavior is intentional or incidental.)
% cat /tmp/funsubs.sh
set -u
unset REPLY
(printf '<%s>\n' "$REPLY")
(printf '<%s>\n' "${| :; }")
(printf '<%s>\n' "${| unset REPLY; }")
% mksh /tmp/funsubs.sh
/tmp/funsubs.sh[3]: REPLY: parameter not set
<>
<>
% ~/src/bash/bash /tmp/funsubs.sh
/tmp/funsubs.sh: line 3: REPLY: unbound variable
<>
<>
% ~/src/zsh/zsh/Src/zsh /tmp/funsubs.sh
/tmp/funsubs.sh:3: REPLY: parameter not set
/tmp/funsubs.sh:4: : parameter not set
/tmp/funsubs.sh:5: : parameter not set
--
vq
- ${| command; } funsub not setting REPLY does not error out with 'set -u' active, Zachary Santer, 2024/12/18
- Re: ${| command; } funsub not setting REPLY does not error out with 'set -u' active,
Lawrence Velázquez <=
- Re: ${| command; } funsub not setting REPLY does not error out with 'set -u' active, Chet Ramey, 2024/12/19
- Re: ${| command; } funsub not setting REPLY does not error out with 'set -u' active, Chet Ramey, 2024/12/23
- Re: ${| command; } funsub not setting REPLY does not error out with 'set -u' active, Zachary Santer, 2024/12/24
- Re: ${| command; } funsub not setting REPLY does not error out with 'set -u' active, Lawrence Velázquez, 2024/12/24
- Re: ${| command; } funsub not setting REPLY does not error out with 'set -u' active, Zachary Santer, 2024/12/25
- Re: ${| command; } funsub not setting REPLY does not error out with 'set -u' active, microsuxxor, 2024/12/25