. (source or dot operator): Run commands from a file `.?

Run a command script in the current shell context.
Syntax
. filename [arguments]

source filename [arguments]

A period `.? is a synonym for `source?
When a script is run using `source? it runs within the existing shell, any variables created or modified by the script will remain available after the script completes. In contrast if the script is run just as filename, then a separate subshell (with a completely separate set of variables) would be spawned to run the script.
There is a subtle difference between executing a script by running .ss64script (dot ss64script) and . ss64script (dot space ss64script)
the first is running a file thats been hidden from the ?ls? command, (although ls -a will show hidden files) the second option will execute ss64script even if it has not been set as an executable with chmod.
Unless you provide an exact path to filename then bash will look first via the PATH variable
and then in the current directory (only if filename is not found in $PATH.)
If any arguments are supplied, they become the positional parameters
when filename 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 filename is not found, or cannot be
read, the return status is non-zero. `source? is a bourne shell builtin and a POSIX `special? builtin
Tags
Comments
Write the first comment
Leave a trace
Name *
Email *
Website
Anti SPAM * Code (1 + 1) =
Leave me a comment *
 
All comments are subject to editorial review
Post being viewed right now
Item date: 08.03.2009
Views: 1406
Item date: 04.02.2009
Views: 844
Item date: 01.08.2009
Views: 344
Item date: 14.05.2009
Views: 1540
Item date: 15.05.2009
Views: 1018
Item date: 14.05.2009
Views: 872
Item date: 23.08.2009
Views: 633
Item date: 04.02.2009
Views: 802
Item date: 18.06.2009
Views: 630