Bash source: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * bash =Overview=")
 
 
Line 3: Line 3:


=Overview=
=Overview=
<code>source</code> is a bash built in and a synonym for <code>.</code>. Read and execute commands from the file specified as argument in the current shell context. If the name of the file specified as argument does not contain a slash, the PATH variable is used to find filename. When bash is not in posix mode, the current directory is searched if file is not found in $PATH. If any arguments are supplied, they become the positional parameters when file is executed. Otherwise the positional parameters are unchanged. The return status is the exit status of the last command executed, or zero if no commands are executed. If file is not found, or cannot be read, the return status is non-zero.

Latest revision as of 05:33, 1 May 2020

Internal

Overview

source is a bash built in and a synonym for .. Read and execute commands from the file specified as argument in the current shell context. If the name of the file specified as argument does not contain a slash, the PATH variable is used to find filename. When bash is not in posix mode, the current directory is searched if file is not found in $PATH. If any arguments are supplied, they become the positional parameters when file is executed. Otherwise the positional parameters are unchanged. The return status is the exit status of the last command executed, or zero if no commands are executed. If file is not found, or cannot be read, the return status is non-zero.