On 11/20/18 6:38 AM, Alexander Reintzsch wrote:
> and if I add an empty command after the assignment statement it behaves as
> expected.
>
> echo "A"
> declare -r vconst="I am fixed."
> echo "B"
> vconst="new value" : # please note the : at the end. (no operation command)
> echo "C" # now printe
Hello Chet,
thank you for your help and pointing to the posix behavior.
Quoting
https://www.gnu.org/software/bash/manual/html_node/Bash-POSIX-Mode.html
"[...]
A non-interactive shell exits with an error status if a variable assignment
error occurs when no command name follows the assignment sta