That's good idea to return value upon exit, they you'll be able to check exit status from external shell.