Use return
.
O retorno bash builtin sairá do script de origem sem interromper o script de chamada (pai / fonte).
Do homem bash:
return [n]
Causes a function to stop executing and return the value specified by n to its caller. If n is omitted, the return status is that of the last command executed in the function body. … If return is used outside a function, but during execution of a script by the . (source) command, it causes the shell to stop executing that script and return either n or the exit status of the last command executed within the script as the exit status of the script. …