Bash exec: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=Internal= * bash =Overview=") |
|||
Line 1: | Line 1: | ||
=Internal= | =Internal= | ||
* [[ | * [[Bash#Built-In_Commands|bash]] | ||
=Overview= | |||
If a command, and optionally arguments, is specified after "exec", the command replaces the shel and no new process is created. If command cannot be executed for some reason, a non-interactive shell exits, unless the execfail shell option is enabled. In that case, it returns failure. An interactive shell returns failure if the file cannot be executed. | |||
If -c is specified, the command is executed with an empty environment. | |||
If -a ''name'' is supplied, the shell passes ''name'' as the zeroth argument to the executed command. | |||
If command is not specified, any redirections take effect in the current shell, and the return status is 0. If there is a redirection error, the return status is 1. | |||
=Overview= | =Overview= |
Revision as of 21:06, 13 May 2019
Internal
Overview
If a command, and optionally arguments, is specified after "exec", the command replaces the shel and no new process is created. If command cannot be executed for some reason, a non-interactive shell exits, unless the execfail shell option is enabled. In that case, it returns failure. An interactive shell returns failure if the file cannot be executed.
If -c is specified, the command is executed with an empty environment.
If -a name is supplied, the shell passes name as the zeroth argument to the executed command.
If command is not specified, any redirections take effect in the current shell, and the return status is 0. If there is a redirection error, the return status is 1.