1

the return built-in

view story
linux-howto

http://unix.stackexchange.com – According to the Open Group, [t]he return utility shall cause the shell to stop executing the current function or dot script. If the shell is not currently executing a function or dot script, the results are unspecified. However, if you run the following snippet func () { ( return 1 ) return 0 } func echo $? the output is 0 (I tried bash and dash, with the same result). So, it seems that return does not cause the shell to stop executing the current function, which would contradict the POSIX standard. Am I missing something? (HowTos)