UNIX for OpenVMS Users, Third Edition

10.1: Executing Scripts

10.1 Executing Scripts

In OpenVMS a DCL command procedure is executed by preceding the filename with the special @ metacharacter. If no file type is specified, DCL will assume the file has a .COM extension. In contrast, if certain conventions are followed, UNIX scripts can be invoked in the same way as any built-in shell command or executable binary program. In addition, the file containing the script is not expected or required to have any particular extension. A UNIX shell script can be invoked as a command if it is protected as both readable and executable ( rx) for the user. If the directory containing the script is not explicitly specified as part of the file name, the shell will automatically use a "search path" to try to locate the specified program. The path (csh) or PATH (bash, ksh, Perl) shell variable contains the set of directories that is to be searched for executable files. Thus, the first executable file (binary or script) that is matched is invoked by the shell. Typically, a user's search path contains standard directories, such as /usr/sbin and /usr/bin (see Section 2.3), which contain many of the programs and scripts that make up the UNIX command set. A common convention is also to specify a period (.) as the last path entry. This forces the shell to search the current directory for the script or program as well. Contrast this with DCL, which automatically assumes the current default directory is...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Online Directories and Search Engines
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.