[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Assign read-only variables return code not usable inline
From: |
Oğuz |
Subject: |
Re: Assign read-only variables return code not usable inline |
Date: |
Tue, 23 Feb 2021 16:54:38 +0200 |
23 Şubat 2021 Salı tarihinde Léa Gris <lea.gris@noiraude.net> 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'); `exit 2' is unreachable there.
--
Oğuz