HP C/iX Reference Manual (31506-90011)

Chapter 8 125
Compiling and Running HP C/iX Programs
Running HP C/iX Programs
RUN MYPROG; INFO="STR1 'STR2 WITH BLANKS' STR3"
yields:
argv[0] = MYPROG.MYGROUP.MYACCT
argv[1] = "STR1"
argv[2] = "STR2 WITH BLANKS"
argv[3] = "STR3"
argv[4] = NULL
argc = 4
info = "STR1 'STR2 WITH BLANKS' STR3"
To include a single quote in a single quoted argument, the following command:
RUN MYPROG; INFO="STR1 'STR2 WITH QUOTE HID' 'DEN' STR3"
yields:
argv[0] = MYPROG.MYGROUP.MYACCT
argv[1] = "STR1"
argv[2] = "STR2 WITH QUOTE HID'DEN"
argv[3] = "STR3"
argv[4] = NULL
argc = 4
info = "STR1 'STR2 WITH QUOTE HID' 'DEN' STR3"
A maximum of 1023 argv[] entries are allowed and the maximum length of the info string
is 279 characters.
Redirection of Standard Files
The special characters <, >, >>, and & may be specified in the INFO string to redirect
standard files for a compiled HP C/iX program. The special characters are described in the
following table.
The redirection characters and the file names which follow these characters do not appear
in the argv vectors or the argc count. For example,
RUN MYPROG; INFO= "FILE1 FILE2 >& OUTFILE"
runs MYPROG with FILE1 and FILE2 passed in argv and redirects both the diagnostic
Table 8-3. Redirection Characters
Character Description
< The name immediately following this symbol in the INFO string is considered a file
name and the standard input for the program is read from that file.
> The name immediately following this symbol in the INFO string is considered a file
name and the standard output of the program is sent to that file.
>> The name immediately following this symbol in the INFO string is considered a file
name and the standard output of the program is appended to the end of the file.
& When included after > or >, this character redirects the diagnostic output as well as
the standard output to the specified file. The diagnostic output cannot be redirected
separately from standard output.