bug-bash
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]