12. The Run-Commands File

12.1 Function

Hercules supports the ability to have console commands automatically executed at startup via the 'run-
commands' file. If the run-commands file is found to exist when Hercules starts then each line of the file is
read and interpreted as a console command, exactly as if the command were entered from the HMC sys-
tem console.

The default filename for the run-commands file is "hercules.rc". The default name may be overridden by
setting the "HERCULES_RC" environment variable.

Except for the 'pause' command (see below), each command read from the run-commands file is logged
to the console preceded by a “>”' (greater-than sign) character. Thus you can easily distinguish between
console commands entered from the keyboard from those entered via the run-commands file.

Comment lines starting with '#' are treated as "silent comments" and are thus not logged to the console
whereas comment lines starting with '*' are treated as "loud comments" and will be logged.

12.2 Run-Commands File Statements

There is a number of different types of commands that can be specified within a run-commands file.
These commands are the following:

“herccmd” (any valid Hercules console command) PAUSE (delay the processing of the next command) # (issue silent comment) * (issue loud comment)

12.2.1 Hercules Console Commands

Descriptive

herccmd

Diagram

Êʬ¬¬ herccmd ¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬ÊÍ

In the run-commands file any valid Hercules console command (“herccmd”) can be specified. This in-
cludes the ‘sh’ (shell) command. Each command that is read from the run-commands file is logged to the
console preceded by a ‘>’' (“greater-than” sign) character. This is to distinguish between console com-
mands entered manually from the keyboard from thosecommands entered via the run-commands file.

Examples:

MAXRATES MIDNIGHT

IPL 0148

12.2.2 PAUSE

Descriptive

nnn nnn.nnn

Diagram

Êʬ¬¬ ¬¬¬§¬¬¬¬¬ nnn ¬¬¬¬¬§¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬ÊÍ



nnn.nnn

A pause command is supported in order to introduce a brief delay before reading and processing the next
line in the file. The value nnn can be any number from 1 to 999 and specifies the number of seconds to
delay before reading the next line. Beginning with Hercules version 4.0 pause can also be specified for
sub-second delays (e.g. "PAUSE 0.125" to delay the next command for 125 milliseconds).

Examples:

PAUSE 2

PAUSE 0.375

12.2.3 # (Silent Comment)

Descriptive

# [
comment]

Diagram

Êʬ¬¬ # ¬¬¬ comment ¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬ÊÍ

Lines starting with '#' are treated as "silent comments". They are intended as comments just for the run-
commands file itself and are thus not logged to the console. That means they are are not visible when
Hercules is started and the run-commands file is executed.

Previous Page Next Page