Automating with UNIX Script Files | Automating with Windows Batch Files


GRIPBatch Switches

Each switch to the command is identified by it's key word. The following lists shows the minimum recommended abbreviation for each key word.

Arguments

When a key word is followed by text strings enclosed in angle brackets (), it indicates optional arguments for the switch. You must supply the arguments depending on what action you want the command to take.

Key Word

Min.

Description

-compile

-c

Specifies the compile option and allows for the compiling of one or more GRIP programs. If the input file is a GRIP source routine (GRS), then it compiles as a single program. If the input file is a list of GRIP programs, then each source file is compiled in the order listed. To compile a list of programs, the "-list" switch must be used and the file must contain one or more GRIP programs. See an example of the format of a Source List File. If a program compiles without errors, then the GRIP intermediate file (GRI) is placed into the directory where its GRS file resides. When using the "-list" switch, each GRS is independent from the others, the entire list is processed, even if an error is found in one of the programs. A GRI is created for each GRS that compiles without any errors.

-link

-l

Specifies the link option and allows for the linking of one or more GRIP programs. If you use the "-list" switch, a link is attempted on all the GRIs in the list. If a program links without errors, then the GRIP executable (GRX) is placed into the directory where the GRI file resides.

-erlst

-e

Specifies that the compile listing output is to change from "ALL" to "ERRORS ONLY". The default is "ALL", and this means that the entire program and error messages are listed when attempting to compile GRIP programs. If you use this switch, then only the errors are listed when attempting to compile GRIP programs.

-run

-r

Specifies the execution option and allows for the execution of only one GRIP program.

  • This switch causes the UNIGRAPHICS image to execute.

-dev=<listing_device>

 

Specifies which listing device is to receive the compilation, link, or execution output. The device names that are available are: lp (line printer), osfile (operating system file), and null (no output). If you the osfile option, then the "-name" switch must be used to specify the name of the operating system file. If you use the lp option, then the environment variable UGII_PRINTER should be used to indicate the desired printer. If you do not use this switch, then the default is the operating system file "nohup.out" when compiling or linking a GRIP program, and the default is the line printer when executing a GRIP program.

-name=<output_file_name>

-n

You only use this switch when the "-dev" switch is set to osfile (operating system file). This switch is set equal to the file specification that is to receive the output.

-dir=<directory_name>

 

Specifies the directory for all file access (i.e. GRS, GRI, GRX, OSFILE, file_list). If you do not use this switch, then the system checks for the environment variable GBATCH_DIRECTORY (first by an operating system environment variable definition, second by an uncommented line in the NX environment defaults file ".ugii_env"). If no definition is found, then the system uses the current directory.

-list

 

If you use this switch, then GCAL expects the filespec to be a list of GRIP programs to be compiled and/or linked. If the switch is not used, then GCAL expects the filename to be the actual name of the GRIP program to be compiled and/or linked.

filespec

 

This is the file specification which is either a file name or the complete path and file name. The file name is either the GRIP program to execute, or the GRIP program to compile and/or link, or the list of GRIP programs to compile and/or link when the "-list" switch is specified.

"string"

 

This is a character string (132 character maximum without any embedded blanks) that is passed to the GPA &GBSTR when the GRIP program is executed. You start and end the string with double quotes. You can pass a string with embedded blanks by defining the environment variable GBATCH_STRING. If you use the environment variable, then do not pass a quoted string on the command line.