Variable Syntax and Usage
Variables are called using SH syntax (the standard Unix shell). For example, if you want to refer to a variable called USER
, include ${USER}
in the Exec property of the command.
The following "Hello World" example shows how you can use variables in a command that would work on a Windows NT/2000 machine. In the example, a variable called MESSAGE
with a value of "Hello World"
is created and used in a command called SHOWMESSAGE, which calls the system echo
command. No files on your system will be changed by following this example.
To see a simple example of variable usage:
- Open the Customizer dialog box for the VCS filesystem by choosing Versioning
Mount Generic Version Control System.
- In the Version Control System Configuration combo box, choose Empty (yourOS).
- If you wish, browse to a directory in the Working Directory field. For the
purposes of this example, you can leave it at the default. No files will be changed by following this example.
- Click the Advanced tab of the Customizer dialog box and click the Edit Variables button to open the Variable Editor dialog box.
- Right-click the Accessory node, choose New Variable from the contextual menu,
type
MESSAGE
in the text field, and click OK.
- Expand the Accessory node and select the MESSAGE node that you just created.
- In the property sheet on the right side of the dialog box, select the Value property and type
Hello World
- Click OK to close the Variable Editor and then click Edit Commands.
- Right-click the Empty node (not the node above it labeled Empty (yourOS)) and choose New
Command, type SHOWMESSAGE
into the text field and click OK.
- Expand the Empty node and select the SHOWMESSAGE node.
In the property sheet on the right side of the dialog box, select the Exec property and type
cmd.exe /x /c "echo ${MESSAGE}"
- In order to view the result of the command in the Output window, set the Display Output property of the SHOWMESSAGE command to True.
- Click OK to close the Command Editor and then click OK to close the Customizer dialog box and mount the filesystem.
- In the Explorer, expand the node for the filesystem you have just mounted, right-click one of the files, and choose Empty
SHOWMESSAGE from the contextual menu.
A window should open displaying the command that was issued (cmd.exe /x /c "echo Hello World"
) and its output, which is Hello World
.
- Unless you plan to further modify the profile for an actual version control system and work in the files in the filesystem, right-click the filesystem's root node and choose Unmount Filesystem.
Legal Notices