File Name
A file with the extension "swt" is treated as a Systemwalker Script.
~.swt
Configuration
A Systemwalker Script consists of a group of command statements. The descriptive contents of scripts are within your discretion as long as you follow the syntax and command forms explained in this chapter. Shown below is the descriptive format of command statements.
command optional argument
A script file is a group of command statements as shown below:
Command statements ... ... ... ...
Startup Arguments
When activating a script, you can assign information to be processed within a script as an argument. The startup arguments specified in conjunction with a script filename can be handled in a script by using the following reserved variables.
argc: | Stores the number of arguments. |
argv: | Stores the contents of arguments. |
A reference is made to an argument after it is broken down into work variables before being retrieved.
The following example retrieves the first argument into the work variable "prm1."
set prm1 [lindex $argv 0]
set: A command that stores a value in a variable.
prm1: The name of a variable that stores a value.
lindex: A command that retrieves a startup argument.
argv: A variable in which a startup variable is stored (it is identified by the dollar sign, $, prefixed to it)
0: Specifies a value (location of argument to retrieve - 1).
Environment Variables
The environment variables have been already stored in the reserved variable "env."
In a script, each environment variable name following "env" is treated as a parenthesized (enclosed in ()) variable name and referring to and updating environment variables is made on env (a name of environment variable).
A variable name used to refer to and update PATH environment variable.
env(PATH)