BuildForge Help

Using Command Output To Set Values

You can generate the value of a variable for a .set or .bset command by sending a command to the server's command interpreter. To use a command within the dot command, enclose the command in backtick characters. For example, the command
.set env SetupGroup "PerlVer=`perl --version`"
sets the variable PerlVer to the output of the perl --version command.

The variables can only store 256 characters; if more are assigned to a variable, the value is truncated.

By default, the system assigns the entire output of a command in backticks to the variable, but you can use range commands in brackets to select which lines from the command output you want to assign to your variable. The range numbers specify lines from the output using a 0-index (the first line is numbered zero, the second 1, etc.). In the following example,
.set env SetupGroup "WindowsIPinfo[0,5-8]=`ipconfig`"
the variable WindowsIPinfo receives the first and sixth through ninth lines of the ipconfig command's output.
The following are all valid range modifiers, selecting single lines, groups of lines or combinations:
[5] 
[4-6]
[1,2,5,8-11]
The system combines lines without any separation; no spaces or carriage returns are added.
Note: Do not mix the backtick form and the standard assignment form of the command.