. (dot)

execute KornShell script in current environment

KornShell Built-in


SYNOPSIS

. file [argument ...]


DESCRIPTION

. (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
 . ./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 more than one argument, . (dot) sets the positional parameters to the argument 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

Path search failed or file is unreadable.

2

Failure because of an invalid command line option.

Otherwise, the exit status is the exit status of the last command executed from the script.


PORTABILITY

POSIX.2. x/OPEN Portability Guide 4.0.

The ability to handle arguments is an extension to the POSIX.2 and XPG standards.


NOTE

This is a special built-in command of the MKS KornShell.


SEE ALSO

Commands:
cd, set, sh, trap


Updated MKS Toolkit [3khat16.ico]HP3000 [3khat16.ico]3kMail [archive16.gif]