Content
Data
license:
Version:
Developer / owner:
Short description:
The manual page and help for the return built-in Bash command. The return command causes a function or a "source" script to return with a given N exit code. If N is not specified, it returns the exit code of the last command.
Man page output
man 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 executed by a trap handler, the last command used to determine the status is the last command executed before the trap handler. If return is executed during a DEBUG trap, the last command used to determine the sta- tus is the last command executed by the trap handler before return was invoked. 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 ei- ther n or the exit status of the last command executed within the script as the exit status of the script. If n is supplied, the return value is its least signif- icant 8 bits. The return status is non-zero if return is supplied a non-numeric argument, or is used outside a function and not during execution of a script by . or source. Any command associated with the RETURN trap is executed before execu- tion resumes after the function or script. [...]
Help output
return --help
return: return [n] Visszatér egy függvényből. Egy függvény vagy egy „source”-olt parancsfájl adott N kilépési kóddal való visszatérését okozza. Ha N nincs megadva, az utolsó parancs kilépési kódjával tér vissza. Kilépési kód: N-nel tér vissza, kivéve ha nem függvényből vagy parancsfájlból akar visszatérni – ekkor sikertelenséget jelez.
Related Content
- 8 views