Previous Topic: Read Operating System Values into Dataset VariablesNext Topic: UNIX Script Example: UNIXGetInfo Script Operator


Sample Scripts for Reading Operating System Values into Dataset Variables

A process can use UNIX script, VBScript, or PerlScript to read operating system variables into operator dataset variables. Each script reads lines from a text file that specifies a host name, a single space, and the operating system running on the host. For example:

JAMES Windows
INDUS Linux
NILE Windows
AMAZON UNIX
YANGTZE Solaris
GILA UNIX

The three scripts save the host names to an indexed field named HostList and the operating system names to an indexed field named OSList.

The process incorporates the following steps:

  1. The UNIX or Windows module passes a text file name. The module gets the file name from a parameter on the appropriate Process tab of the script operator properties.
  2. The UNIX or Windows module creates and initializes the C2OSVD environment variable with a path to a unique folder.

    One instance of a script operator uses the folder that the C2OSVD environment variable specifies. The instance is not repeated or overwritten by any subsequent instance of that or any other script operator.

  3. The UNIX or Windows module creates the folder that the C2OSVD environment variable references.
  4. The script creates folders named HostList and OSList in the folder that the C2OSVD environment variable references.
  5. The script reads each line of the text file and takes the following actions:

    These files generate two indexed operator dataset variables HostList and OSList.

  6. The script writes the number of lines it read to the files to a file named %C2OSVD%/NumRowsRead.

    This file generates an operator dataset variable named NumRowsRead.