SOURCE(1)

NAME
source - execute commands in the current environment

SYNOPSIS
source name [arg ...]
. name [arg ...]

DESCRIPTION

source is a special built-in command that executes commands from a function or a file in the current environment.

If name refers to a function defined with the function name syntax, the function executes in the current environment as if it had been defined with the name*`()` syntax so that there is no scoping. Otherwise, commands from the file defined by *name are executed in the current environment. Note that the complete script is read before it begins to execute so that any aliases defined in this script will not take effect until the script completes execution.

When name refers to a file, the PATH variable is searched for the file containing commands. In this case execute permission is not required for name.

If any args are specified, these become the positional parameters for the duration of the function or script and are restored upon completion.

EXIT STATUS

If name is found, then the exit status is that of the last command executed. Otherwise, since this is a special built-in, an error will cause a non-interactive shell to exit with a non-zero exit status. An interactive shell returns a non-zero exit status to indicate an error.

SEE ALSO

command(1), ksh(1)

AUTHOR
David J. Korn, et. al.

COPYRIGHT
2019, David J. Korn, et.al.