Hitachi

Job Management Partner 1 Version 10 Job Management Partner 1/Advanced Shell Description, User's Guide, Reference, and Operator's Guide


. command (executes a shell script)

Organization of this page

Format

. filename  [args]

Description

This command executes a shell script in the current shell. The shell script specified in filename is executed in the shell environment. The current directory of the shell script specified in filename will be the same as the current directory of the current shell being used by the . (dot) command.

Variables and functions that are set and defined in the specified shell script can be used in the current shell environment even after the specified shell script terminates. Also, variables and functions that were set or defined before the specified shell script was started can be used in the specified shell script. However, extended script commands cannot be used in the specified shell script. If an extended script command is encountered, it will be handled as a comment. For details about the extended script commands, see 9.5 Extended script commands.

Arguments

filename

Specifies the file name of the shell script that is to be executed in the current shell.

args

Specifies positional parameters to be used in the specified shell script. How the value of a positional parameter is set depends on whether args was specified and whether the positional parameter is changed in the specified shell script file, as summarized in the following table:

args is specified

Positional parameter is changed in the specified shell script file

Positional parameter is not changed in the specified shell script file

Yes

  • The value of the positional parameter in the file will be the value specified in the args argument.

  • The value of the positional parameter after the file has terminated will be its value just before execution of the . (dot) command.

Same as at the left.

No

  • The value of the positional parameter in the file will be the value just before execution of the . (dot) command.

  • The value of the positional parameter after the file has terminated will be the new value acquired in the file.

  • The value of the positional parameter in the file will be the value just before execution of the . (dot) command.

  • The value of the positional parameter after the file has terminated will be its value just before execution of the . (dot) command.

Return codes

Return code

Meaning

0 to 255

Normal termination

  • The return code is set by the script that executed.

0

Normal termination

  • The command executed but no file was specified in the filename argument.

1

Error termination

  • A file other than a regular file was specified in the filename argument.

  • The file specified in the filename argument could not be read.

Notes

Usage example