bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inconsistent readonly error behavior


From: Oğuz
Subject: Re: inconsistent readonly error behavior
Date: Tue, 22 Dec 2020 08:45:55 +0300

On Tue, Dec 22, 2020 at 7:28 AM Travis Everett <travis.a.everett@gmail.com>
wrote:

> Configuration Information [Automatically generated, do not change]:
> Machine: x86_64OS: darwin17.7.0
> Compiler: clang
> Compilation CFLAGS: -g -O2 -Wno-parentheses -Wno-format-security
> uname output: Darwin ecf1160e 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug
> 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64
> Machine Type: x86_64-apple-darwin17.7.0
> Bash Version: 5.
> 0Patch Level: 18
> Release Status: release
>
> Description:
>     While trying to intentionally trap/ignore EXIT in a sourced script, I
> noticed that I couldn't keep it from exiting when it tried to overwrite
> PATH, which I had set to readonly. When I tried to minimize the repro case,
> I realized the behavior seems to differ between simple command and command
> list contexts.
>
> Repeat-By:
>
>     readonly sigh=1
>
>     sigh=2
>     : reached
>
>     sigh=2a; : skipped
>     sigh=2b || : skipped
>
>     if true; then
>         sigh=3
>         : skipped
>     fi


I don't understand what is wrong here. Is there any shell that doesn't
discard the current line or the lines that constitute a compound command
when a shell error occurs?


>     I also have a gist with a slightly longer example (and output from
> bash, bash-sh, and osh:
> https://gist.github.com/abathur/8d18853e06f2a8cf3a97e45acda17f68
>
> T
>


reply via email to

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