On 2/23/21 7:54 AM, Léa Gris wrote:
https://ideone.com/iw2pSv
#!/usr/bin/env bash
declare -r r
r=2 || exit 2
OK, let's pick this one. This is what POSIX calls a "variable assignment
error" in
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_01
(you've om
23 Şubat 2021 Salı tarihinde Léa Gris yazdı:
> https://ideone.com/iw2pSv
>
> #!/usr/bin/env bash
>> declare -r r
>> r=2 || exit 2
>
>
There is no command substitution in `r=2', it will either succeed and
return zero, or fail and cause the shell to discard the whole command (`r=2
|| exit 2'); `e
https://ideone.com/iw2pSv
#!/usr/bin/env bash
declare -r r
r=2 || exit 2
echo 'still there with $?='$?', after: r=2 || exit 2'
if ! r='hello'; then exit; fi
echo "still there with \$?=$?, after: if ! r='hello'; then exit; fi"
typeset -p r
Output:
still there with $?=1, after: r=2