[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: local -r issue in conjunction with trap
From: |
Koichi Murase |
Subject: |
Re: local -r issue in conjunction with trap |
Date: |
Sat, 16 Jul 2022 08:06:20 +0900 |
2022年7月16日(土) 7:28 Lawrence Velázquez <vq@larryv.me>:
> You can't shadow a readonly variable:
>
> https://lists.gnu.org/archive/html/bug-bash/2019-03/msg00152.html
> https://lists.gnu.org/archive/html/bug-bash/2019-03/msg00153.html
> https://lists.gnu.org/archive/html/bug-bash/2020-04/msg00201.html
> https://lists.gnu.org/archive/html/bug-bash/2020-04/msg00204.html
We can shadow local readonly variables. What we cannot are global
readonly variables.
It seems to me a bug. While the following works,
$ bash-dev -ec 'T(){ local -r v=; }; trap T 0; F() { local -r v=; exit; }; F'
the following fails
$ bash-dev -e <<< 'T(){ local -r v=; }; trap T 0; F() { local -r v=; exit; }; F'
main: line 1: local: v: readonly variable
Tested on the current devel 87a6e89e (+ define(relstatus, release) in
configure.ac)
--
Koichi
- local -r issue in conjunction with trap, Robert Stoll, 2022/07/15
- Re: local -r issue in conjunction with trap, Lawrence Velázquez, 2022/07/15
- Re: local -r issue in conjunction with trap, Lawrence Velázquez, 2022/07/15
- Re: local -r issue in conjunction with trap,
Koichi Murase <=
- Re: local -r issue in conjunction with trap, Lawrence Velázquez, 2022/07/15
- Re: local -r issue in conjunction with trap, Chet Ramey, 2022/07/17
- Re: local -r issue in conjunction with trap, Koichi Murase, 2022/07/17
- Re: local -r issue in conjunction with trap, Chet Ramey, 2022/07/18
- Re: local -r issue in conjunction with trap, Chet Ramey, 2022/07/18
Re: local -r issue in conjunction with trap, Robert Elz, 2022/07/16
Re: local -r issue in conjunction with trap, Dale R. Worley, 2022/07/16