16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

. (dot)<br />

. (dot) — Run a shell file in the current environment<br />

Format<br />

Description<br />

Usage notes<br />

Localization<br />

Exit Values<br />

Portability<br />

. file [argument ...]<br />

. (dot) runs a shell script in the current environment and then returns. Normally, the<br />

shell runs a command file in a child shell so that changes to the environment by<br />

such commands as cd, set, and trap are local to the command file. The . (dot)<br />

command circumvents this feature.<br />

If there are slashes in the filename, . (dot) looks for the named file. If there are no<br />

slashes . (dot) searches for file in the directories specified in the PATH variable.<br />

This may surprise some people when they use dot to run a file in the working<br />

directory, but their search rules are not set up to look at the working directory. As a<br />

result, the shell doesn’t find the shell file. If you have this problem, you can use:<br />

. ./file<br />

This indicates that the shell file you want to run is in the working directory. Also, the<br />

file need not be executable, even if it is looked for on the PATH. If you specify an<br />

argument list argument ..., . (dot) sets the positional parameters to the arguments<br />

while running the shell script, then restores the invoker’s positional parameters. If<br />

no argument list is specified, the shell script has the same positional parameters as<br />

the invoker. Any changes made to the positional parameters (e.g. by the set<br />

command) in the shell script remain in effect when the . (dot) command ends.<br />

1. . (dot) is a special built-in shell command.<br />

2. The file specified is treated as a shell script containing shell commands. Files<br />

which are not shell scripts (e.g. REXX execs, executable programs) should not<br />

be specified as file.<br />

. (dot) uses the following localization environment variables:<br />

v LANG<br />

v LC_ALL<br />

v LC_MESSAGES<br />

v NLSPATH<br />

See Appendix F for more information.<br />

1 The path search failed<br />

2 Failure because of an incorrect command-line option<br />

Otherwise, the exit status is the exit status of the last command run from the script.<br />

P<strong>OS</strong>IX.2, X/Open Portability Guide, <strong>UNIX</strong> systems.<br />

242 z/<strong>OS</strong> <strong>V1R9.0</strong> <strong>UNIX</strong> <strong>System</strong> <strong>Services</strong> <strong>Command</strong> Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!