TMF Reference Manual (G06.24+)

Using TMFCOM
HP NonStop TMF Reference Manual522418-002
2-5
Using TMFCOM From a Command File
If any command on the line fails, TMFCOM reports the error and terminates without
executing any of the subsequent commands.
Using TMFCOM From a Command File
TMFCOM can also read commands from an input file known as a command file. A
command file is simply a text file that contains the TMFCOM commands you want to
execute, which you prepare using your standard text editor. You might, for example,
create a command file named TMFINIT that contains the following commands:
SET AUDITTRAIL ACTIVEVOLS ($MAT1, $MAT2)
SET AUDITTRAIL OVERFLOWVOLS $MAT2
SET AUDITTRAIL RESTOREVOLS $MAT2
ADD AUDITTRAIL MASTER, AUDITDUMP ON, FILESPERVOLUME 3, &
BEGINTRANSDISABLE 90, OVERFLOWTHRESHOLD 75
ALTER AUDITDUMP MASTER, COPIES 2 PARALLEL
ALTER CATALOG RETAINDEPTH 4
To execute the commands in this command file, enter the TMFCOM command
keyword and specify the command file name in the IN parameter:
4> TMFCOM /IN TMFINIT/
TMFCOM begins the session, reading and executing each command from the
command file. When TMFCOM encounters an EXIT command or reaches the end of
the command file, TMFCOM terminates the session and returns control to TACL. If
TMFCOM encounters an error while reading the command file, TMFCOM displays an
error message and terminates the session.
If you are using TMFCOM interactively, you can use the OBEY command to execute a
command file within your current session. If you regularly use a series of sequential
operations in your interactive sessions, for example, you might want to specify these in
a command file. Then, each time you need these operations, you can invoke them
with a single OBEY command rather than with multiple individual commands. If you
have created a command file named REPORT that contains several STATUS
commands, for instance, you could execute all these commands by simply entering:
TMF 7> OBEY REPORT
In response, TMFCOM executes all the commands entered in the file named REPORT.
If you decide later that you want different reports, you can change the command file
and then enter the OBEY command again. Using command files makes performing
repeated tasks very convenient.
A command file can, in turn, contain OBEY commands. OBEY commands can be
nested up to four levels.
Caution. Never include exclamation points (!) in command files. When TMFCOM encounters
certain commands, it normally sends you a message asking you to confirm your request; an
exclamation point in the command file, however, prevents transmittal of this message. Such
messages and your responses to them can be a great help in avoiding errors.