<< back to sysax.com Product page

2.1. Setting and updating variables

A variable is automatically created and set to an empty string when first used. The setvar command or the strprint command can be used to set or update the values stored in a variable. A variable holds both numbers and strings and can be treated as a number or string based on the context. The setprotectedvar command is used to hide passwords and other strings. The contents of a protected variable will be automatically decrypted when the variable is passed to the ftpconnect* group of commands, the certload commnd or the pkeyload command. In all other cases, only the encrypted value is made available. The encrypted string for a protected variable should be generated from the command line using the -protectstring option.

Exhibit 2.1. Syntax of commands for setting and updating variables

setvar <variable>, <string or number>;

strprint <variable>, <sequence of comma separated strings, numbers, and variables>;

setprotectedvar <variable>, <encrypted string generated from the command line using the -protectstring option>;

Exhibit 2.2. Examples for using the commands for setting and updating variables

setvar ~my_number, 5;

setvar ~my_string, "this is a string";

strprint ~my_value, "the value is ", 5, " bytes";

setprotectedvar ~my_value, ":#!FEC016d09ab332ff7edfdbe90dd212c8b0e37dd033bc6cd7ad3d31f5a4075e94d1f1c0ef8cb423837f63e00000000000000000000000000000003UsokpdRYrZyypl5Ir9XN4Jwp0cXNWv8f6mD4vq4d4WQZOxQFFxGWFuk1ZFo9OXw/ZGCM8g5Z08ASGrrdPLDDux2QA/6wtec7/yUg1mmVUAdLeWE=";