if /dev/pts has wrong permissions, expect fails (as expected), but return code is zero:
$ expect -c "spawn -noecho true"
The system has no more ptys. Ask your system administrator to create more.
while executing
"spawn -noecho true"
$ echo $?
0
Seems like return code should be non-zero
It just returns exit code 0 when the interpreter finds syntax errors.
So the following example has "set -e", but the script does not stop.
I am afraid that unit-tests could not find the bug depending on how they are written.
(Actually this happened in a production environment, an app calls the script)
Last edit: mijies 2018-10-27