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: Tue, 24 Dec 2024 19:50:43 -0500

On Tue, Dec 24, 2024, at 12:10 PM, Zachary Santer wrote:
> Some other nonsense real quick:
>
> zsant@Zack2021HPPavilion MSYS ~/repos/bash
> $ : ${|  REPYL="whatever"}
> ; }
> bash: syntax error near unexpected token `;' while looking for matching `}'
> bash: DEBUG warning: current_token (10) != shell_eof_token (})
> bash: syntax error

What do you expect to happen here?


> zsant@Zack2021HPPavilion MSYS ~/repos/bash
> $ : ${|  REPYL="whatever"; }
> bash:  : command not found
>
> zsant@Zack2021HPPavilion MSYS ~/repos/bash
> $ : ${| REPYL="whatever"; }
> bash:  REPYL=whatever: command not found
>
> zsant@Zack2021HPPavilion MSYS ~/repos/bash
> $ : ${| REPYL="whatever"; }
> bash:  REPYL=whatever: command not found

The second and third examples above look exactly the same.  Are
they supposed to differ somehow?

Anyway, I'm not seeing these errors.  Judging from the messages,
I'd guess that you accidentally introduced a nonblank whitespace
character immediately after '${|'.

        bash-5.3$ : ${| REPYL="whatever"; }
        bash-5.3$ LC_ALL=en_US.UTF-8
        bash-5.3$ nbsp=$'\uA0'
        bash-5.3$ eval ': ${|'"$nbsp"' REPYL="whatever"; }'
        bash:  : command not found
        bash-5.3$ eval ': ${|'"$nbsp"'REPYL="whatever"; }'
        bash:  REPYL=whatever: command not found


> zsant@Zack2021HPPavilion MSYS ~/repos/bash
> $ : ${|
>  REPYL="whatever"
> }
>
> The first thing within a ${| command; } funsub has to be a command if
> it's on the same line as ${| ?

No.


-- 
vq



reply via email to

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