sh return: can only `return' from a function or sourced script sh return: can only `return' from a function or sourced script shell shell

sh return: can only `return' from a function or sourced script


I guess you mean

exit 2

and

exit 0

Also, have a second look at the syntax of test.