HPlogo Command Interpreter Access and Variables Programmer's Guide: Series HP 3000 Computer Systems > Chapter 2 Accessing the Command Interpreter

Issuing Commands Through Command Files

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Command files, like UDCs, can be created to execute single or multiple commands. Unlike UDCs, only one routine can be included in a command file.

Creating a Command File

Any editor can be used to create a command file and to modify or delete a portion of it. The file name is used to invoke the command file. There is no cataloging procedure for a command file.

Command files are often used to test a new user command before establishing it as a UDC. Because they are easier to create and modify than UDCs, command files are also used to execute user commands that change frequently. Command files are not as secure as UDC files because they can be deleted inadvertently with the PURGE command (unless it is protected with a lockword, program security, or access rights).

The PURGE command permits you to delete files using wildcard specifications, with levels of confirmation. Refer to MPE/iX Commands Reference Manual (32650-90003).

For information on HFS (hierarchical file system) security provisions, refer to New Features of MPE/iX: Using The Hierarchical File System (32650-90351).

Executing a Command File

To execute a command file, enter the command file name at the CI prompt. In processing any command, the CI first checks the UDC files and MPE/iX built-in commands. If no match is found, the CI automatically searches for a program file or command file of the same name. The CI uses the following sequence to identify the command input it has received:

  1. User-, account-, and system-level UDCs.

  2. Built-in MPE/iX commands.

  3. Program and command files.

If no group or account is specified for the command file name, a search pathway determines the group and account sequence for the search. By default, the current group is checked first, followed by the PUB group of the logon account, followed by PUB.SYS. This search pathway can be altered by modifying the predefined variable HPPATH. (Modifying predefined variables is described in the following chapter.)

NOTE: To change the HPPATH variable to contain your current working directory—in HFS (hierarchical file system) syntax—execute this command:
   SETVAR HPPATH "!!HPCWD:"

Specifying Options for Command Files

The RECURSION and LOGON options specified for UDCs are not applicable to command files. Other options available with UDCs can be used in command files.

If a command, UDC, or another command file is called from a command file, the standard search path is used: UDCs, built-in MPE/iX commands, command or program files. The RECURSION option, therefore, is unnecessary for command files.

Command files cannot be invoked automatically when a user logs on to the system. A command file can be executed at logon, however, by calling the command file through a logon UDC.

Feedback to webmaster