./a.sh: line 1: return: can only `return' from a function or sourced script
Not all Linuxes return this problem, however, it's enough anoying if you want to keep the script for all the platforms.
There is a simple solution for this, though!
# $1 - error code
You can check this out by yourself. Write a sctipt with the above example, run it and check the value of $?