. (dot)execute KornShell script in current environment |
KornShell Built-in |
.
file [argument ...]
.
(dot) executes a KornShell script in the current
environment and then returns. Normally the shell executes a command file in a
subshell so that changes to the environment by commands like
cd
,
set
, and
trap
are local to the command file.
The .
(dot) command circumvents this feature.
If there are slashes in the file name, .
(dot) looks for the
named file. If there are no slashes, .
(dot) uses the search
PATH
variable to find file.
This may surprise some people when they use dot to execute a file under the
current directory, but their search rules are not set up to look at the
current directory. As a result, the shell doesn't find the file.
If you have this problem, you can use
This indicates that the shell file you want to run is in the current directory. Also, the file need not be executable, even if it is looked for on the. ./file
PATH
.
If you specify more than one argument, .
(dot) sets the positional parameters to the argument list before execution.
PATH
contains a list of directories that .
(dot) searches
when attempting to find file.
1
Path search failed or file is unreadable.
2
Failure because of an invalid command line option.