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:

  1. Open the Customizer dialog box for the VCS filesystem by choosing Versioning Mount Generic Version Control System.
  2. In the Version Control System Configuration combo box, choose Empty (yourOS).
  3. 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.
  4. Click the Advanced tab of the Customizer dialog box and click the Edit Variables button to open the Variable Editor dialog box.
  5. Right-click the Accessory node, choose New Variable from the contextual menu, type MESSAGE in the text field, and click OK.
  6. Expand the Accessory node and select the MESSAGE node that you just created.
  7. In the property sheet on the right side of the dialog box, select the Value property and type
    Hello World
  8. Click OK to close the Variable Editor and then click Edit Commands.
  9. 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.
  10. Expand the Empty node and select the SHOWMESSAGE node.
  11. In the property sheet on the right side of the dialog box, select the Exec property and type
    cmd.exe /x /c "echo ${MESSAGE}"
  12. In order to view the result of the command in the Output window, set the Display Output property of the SHOWMESSAGE command to True.
  13. Click OK to close the Command Editor and then click OK to close the Customizer dialog box and mount the filesystem.
  14. 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.

  15. 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.
See also
Variables in VCS Commands
Creating a New Variable
Runtime Variables
Configuring the VCS Profile Customizer
Substitution Formats for Variables

Legal Notices