Hi,

expected:
$ i=0; ((i = i + 1)); echo $?
0

expected:
$ i=0; ((++i)); echo $?
0

unexpected:
$ i=0; ((i++)); echo $?
1

i is always set to 0, the result is always non-zero, but the return code
differs.


More info:

a stable hardened Gentoo Linux:


$ bash --version
GNU bash, version 5.1.8(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.





Greetings from Hamburg--
Toralf

Reply via email to