myfunc() { return 1 }
if myfunc; then echo "success" else echo "failure" fi
myfunc() { local myresult='some value' echo $myresult }
result="$(myfunc)"
myfunc() { echo "hello $1" }
# Same as above (alternate syntax) function myfunc() { echo "hello $1" }
myfunc "John"