gtpo1m5kOperations

ZFILE-Activate a TPF Segment or Script

Use this command to activate a TPF segment or script from the command line.

Requirements and Restrictions

Format




path
is the path of the file, which contains the call information for the segment or script to be activated.

option
is an option that you code into the segment or script being activated. The options, which always begin with a dash (-), are based on how the segment or script was coded. If you specify more than one option, you can specify these options separately or together. For example, if -l and -a are valid options, you can enter one of the following:

parameter
is an input to path, which you code in the segment or script being activated. The parameters are based on how the segment or script was coded.

Additional Information

Examples

In the following example, a TPF segment is activated from the command line. File /usr/local/test contains the string #!QZZ8 in the first line of the file. For this, TPF segment QZZ8 is written in C language and contains a function to print Hello, World!

+--------------------------------------------------------------------------------+
|User:   ZFILE /usr/local/test                                                   |
|                                                                                |
|System: FILE0001I 08:14:31 START OF DISPLAY FROM /usr/local/test                |
|                                                                                |
|        Hello, World!                                                           |
|                                                                                |
|        END OF DISPLAY                                                          |
|                                                                                |
+--------------------------------------------------------------------------------+

In the following example, a script stored in a file is activated from the command line. The current working directory is /usr/bin. File perl, representing the path parameter, contains the string #!QZZ9 in the first line of the file. For this, TPF segment QZZ9 contains the TPF code for a scripting language such as the Perl interpreter. File script, representing the parameter parameter, contains the following two lines:

#!/usr/bin/perl
print 'Hello, World!'

The scripting language is called through file perl and is passed the parameter script. The scripting language interprets the input and the result is displayed.

+--------------------------------------------------------------------------------+
|User:   ZFILE script                                                            |
|                                                                                |
|System: FILE0001I 08:14:31 START OF DISPLAY FROM script                         |
|                                                                                |
|        Hello, World!                                                           |
|                                                                                |
|        END OF DISPLAY                                                          |
|                                                                                |
+--------------------------------------------------------------------------------+

In the following example, a script is entered on the command line. The file /usr/bin/perl contains the string #!QZZ9 in the first line of the file. For this, TPF segment QZZ9 contains the TPF code for a scripting language such as the Perl interpreter. The -e option and 'print "Hello, World!\n";' are passed to the scripting language as an option and a parameter, respectively. The scripting language interprets the input and the result is displayed.

+--------------------------------------------------------------------------------+
|User:   ZFILE /usr/bin/perl -e 'print "Hello, World!\n";'                       |
|                                                                                |
|System: FILE0001I 08:14:31 START OF DISPLAY FROM perl -e 'print "Hello, Wor...  |
|                                                                                |
|        Hello, World!                                                           |
|                                                                                |
|        END OF DISPLAY                                                          |
|                                                                                |
+--------------------------------------------------------------------------------+

Related Information