[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] errexit and attempting to change readonly functions
From: |
Chet Ramey |
Subject: |
Re: [Help-bash] errexit and attempting to change readonly functions |
Date: |
Tue, 1 Oct 2019 11:23:01 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
On 9/27/19 6:12 AM, Andreas Kusalananda Kähäri wrote:
> A function can be made read-only with
>
> readonly -f func
>
> This stops it from being unset or redefined:
>
> $ func () { echo hello; }
> bash: func: readonly function
>
> However, with the errexit shell option set, I would expect the shell
> to exit when doing this
It's an oversight, probably dating back to when POSIX only required the
shell to exit if a simple command failed when errexit is enabled. I'll
change it for the next release.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU address@hidden http://tiswww.cwru.edu/~chet/
- Re: [Help-bash] errexit and attempting to change readonly functions,
Chet Ramey <=