./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
fun_return() {
return $1
}
fun_return 1
You can check this out by yourself. Write a sctipt with the above example, run it and check the value of $?
No comments:
Post a Comment