Filterfile(); Findnewest() - IBM Prerequisite Scanner User Manual

Table of Contents

Advertisement

Input parameters
String cmd
String line_patt
Number after_line
String info_patt
Return values
String filterCommand

filterFile()

Reads and filters the contents of a file to a scripting dictionary object.
Purpose
This function reads each line of the file and passes each line with the search
pattern to the "getFirstMatch()" on page 121 function. If it returns a match and the
line does not already exist in the dictionary object, the line is written to the
dictionary object. The function loops until the end of the file is reached and then
returns the dictionary object.
Syntax
filterFile(fileName, patt)
Input parameters
String fileName
String patt
Return values
Dictionary dic.keys

findNewest()

Finds the latest configuration file in an array.
Purpose
This function loops through the array and determines which file in the array is the
latest configuration file. It returns the name of the file.
118
Prerequisite Scanner: User's Guide
The name of the command to execute.
The line pattern for which to search in the result from that command's
execution.
The number of lines after which the search for the information pattern stops.
The information pattern for which to search in each line from the result of the
command.
Returns the contents of the dictionary object as a single string.
The file to be filtered.
The pattern for which to search in each line in the file.
Returns thedic dictionary object with the filtered lines from the file.

Advertisement

Table of Contents
loading

Table of Contents