Ralf Treinen Tue, 10 Jan 2017 23:42:20 -0800
Indeed, the POSIX standard says: If n is specified, but its value is not between 0 and 255 inclusively, the exit status is undefined.
Please replace "exit -1" by "exit 255". Thanks -Ralf.