MPE/iX Shell and Utilities Reference Manual, Vol 1

dot(1) MPE/iX Shell and Utilities dot(1)
NAME
. (dot) — execute shell file in current environment
SYNOPSIS
. file [argument ...]
DESCRIPTION
. (dot) executes a shell 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 shell file. If you have this prob-
lem, you can use
. ./file
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
PATH
. If you specify an argument list argu-
ment ..., . (dot) sets the positional parameters to this list before execution.
ENVIRONMENT VARIABLES
PATH
contains a list of directories that .(dot) searches when attempting to find file.
DIAGNOSTICS
Possible exit status values are:
1 Returned if the path search fails or file is unreadable.
Otherwise, the exit status is the exit status of the last command executed from the script.
Messages
Because this utility is built into the MPE/iX Shell, see the sh(1) man page for a complete list of
error messages that you may receive when using it.
PORTABILITY
POSIX.2. x/OPEN Portability Guide 4.0. All UNIX systems.
NOTE
This is a special built-in command of the shell.
Commands and Utilities 1-189