Use this command to activate a TPF segment or script from the command
line.
Requirements and Restrictions
- The parameters for this command are case-sensitive. You
must enter the parameters exactly as shown in the syntax
diagram.
- You can enter this command only in CRAS state or higher.
- The activated segment must contain a main function.
Format
- path
- is the path of the file, which contains the call information for the
segment or script to be activated.
- If you are activating a TPF segment, the first line of the file must
contain the name of the segment to be activated in the form #!xxxx,
where xxxx is the TPF segment name.
- If you are activating a script, the first line of the file must contain
the file system file used to process the script in the form
#!/pppp/ffff, where pppp is the path to the file
system file and ffff is the name of that file.
- 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:
- ZFILE path -l -a parameter
- ZFILE path -la parameter
- 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
- Online help information is available for this command. To display
the help information, enter one of the following:
ZFILE HELP
ZFILE ?
In addition, the correct command syntax is displayed if you enter the syntax
incorrectly.
- Before you activate a script or TPF segment, set the access permissions of
the file to execute (or run). See ZFILE chmod-Change the Access Permissions of a File or Directory for more information about setting access
permissions.
- You can use a vertical bar, or pipe (|), to direct data so the output from
one process becomes the input to another process. This type of one-way
communication allows you to combine ZFILE commands on one line to create a
pipeline. For example, the following pipeline uses the standard output
(stdout) stream from the ZFILE ls command and redirects it to the
standard input (stdin) stream of the ZFILE grep command to search
for those lines containing the word Jan.
ZFILE ls -l | grep Jan
The result is filtered output from the ZFILE ls command displaying only
the lines containing the word Jan in any position.
You can use pipes only with a combination of ZFILE commands where the
command on the left-hand side of the pipe provides data through
stdout and the right-hand side accepts data through
stdin.
- You can redirect the standard input (stdin) stream from the
keyboard to a file by specifying the redirection character (<)
followed by the file name from which you want the input read.
You can redirect the standard output (stdout) stream from the
display terminal to a file by specifying one of the redirection characters
(> or >>) followed by the file name to which you want
the output written. The > character writes the output to a
file. The >> character appends the output to an existing
file.
You can redirect the standard error (stderr) stream from the
display terminal to a file by specifying one of the redirection characters
(2> or 2>>) followed by the file name to which you want
the error output written. The 2> character writes the error
output to a file. The 2>> character appends the error output
to an existing file.
- Note:
- When you use the > or 2> character, if the file that
you are redirecting data to already exists, the file is overwritten and any
data in that file is lost. If you do not want to overwrite the file,
ensure that you use the >> or 2>> character.
- This command supports the following three quoting mechanisms, which allow
you to override the special meaning of some characters:
- escape character (\)
- preserves the literal value of the character that follows. To
ignore the special meaning of a character, escape it by placing a backslash
(\) in front of it. In the example that follows, environment
variable PATH is /bin:/usr/bin:., the first
dollar sign ($) is escaped because of the preceding backslash, and the
second dollar sign takes on a special meaning.
User: ZFILE echo \$PATH is $PATH
System: $PATH is /bin:/usr/bin:.
- single quotation marks (' ')
- preserves the literal value of all characters between the opening single
quotation mark and the closing single quotation mark. For example,
entering ZFILE echo '*' displays an asterisk
character (*). Without the single quotation marks, the files
in the current working directory are displayed.
- double quotation marks (" ")
- preserves the literal value of all characters between the opening double
quotation mark and the closing double quotation mark except the dollar sign
($), the backquote (`), and the backslash (\).
This allows you to use the escape character inside double quotation marks,
which you cannot do in single quotation marks.
For example, entering ZFILE echo "\$PATH is \"$PATH\""
displays $PATH is "/bin:/usr/bin:."
If you want to use the literal meaning of any of the following
characters, you must always use a quoting mechanism:
left angle bracket (<)
| right angle bracket (>)
| ampersand (&)
|
backquote (`)
| backslash (\)
| dollar sign ($)
|
double quotation mark (")
| new-line (\n)
| left parenthesis ( ( )
|
right parenthesis ( ) )
| semicolon (;)
| single quotation mark (')
|
blank space
| tab
| vertical bar (|)
|
In addition, use a quoting mechanism when any of the following characters are
used in a way that takes on a special meaning but you want to use the literal
meaning:
asterisk (*)
| equal sign (=)
| left square bracket ( [ )
|
number sign (#)
| question mark (?)
| tilde (~)
|
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