bug-bash
[Top][All Lists]
Advanced

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

inconsistent readonly error behavior


From: Travis Everett
Subject: inconsistent readonly error behavior
Date: Mon, 21 Dec 2020 22:28:15 -0600

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 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]