DataFile Script Example

As an example of how to script with DataFiles, consider the not-uncommon function of scanning a subnet for devices that respond to ping. For such a function, submit this DataFile definition ... a record designed for a numeric IP, which requires 15 characters:

Continuing with this example, submit this script ... which interacts with a datafile of the preceeding format named "devices":

As explaination, note that the script walks base "192.168.2." from suffix "1" to suffix "254" testing for ping response. Note that the assignment expression where "ipbase + ipsuffix" is added is automatically interpreted as concatenation because ipbase values are not found to be numeric, and "+" means concatenation when either value is not numeric. Further, when an IP responds it is added to the devices DataFile providing this content on my LAN when the script completes:

Such a DataFile, whether manually created or built by script execution, can readily be used to provide IP destinations for any type of scanning script (where the DataFile field contents are used as script value source instead of storage). In general, there's no limitation to DataFile / script interaction and the example is only intended to serve as example of how DataFiles can provide non-volatile storage of script values.

© 2014 ComroeStudios LLC. All Rights Reserved.