I have a shell script incrementing a variable like in the example below with set -e:
$ var=0; echo $? 0 $ ((var++)); echo $? 1 $ ((var++)); echo $? 0 $ ((var++)); echo $? 0 $ echo $var; echo $? 3 0 $ bash --version GNU bash, version 4.2.46(1)-release (x86_64-redhat-linux-gnu) Copyright (C) 2011 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. $
The script exits unexpectedly. The thing is that the exact same script doesn't exit the same way when running it locally on a MacBook. The bash shell on the MacBook behaves exactly the same way when running the example above.
Does anyone have any clue what is going on here?