tamalsaha / learn-bash

0 stars 0 forks source link

How to exit a function in bash #24

Open tamalsaha opened 4 years ago

tamalsaha commented 4 years ago

https://stackoverflow.com/questions/18042279/how-to-exit-a-function-in-bash

return [n] From help return

return: return [n]

Return from a shell function.

Causes a function or sourced script to exit with the return value specified by N. If N is omitted, the return status is that of the last command executed within the function or script.

Exit Status: Returns N, or failure if the shell is not executing a function or script.

tamalsaha commented 4 years ago

https://linuxize.com/post/bash-functions/