Buildforge .bset - set variable as output of OS command
I am trying to define a buildforge command where I read a text file and want to assign the second line of the file to a variable.
According to Buildforge on-line help document this should be possible. But i can't seem to get it working
e.g. my text file contains 2 lines
- Websphere Version
- ws7
I wish to assign text from second line to a variable, so I tried
.bset env "WS_VERSION_CAT[1] = `cat ${BF_ROOT}/wsVersion.txt`"
but the output I get is
409 6/10/13 7:59 PM ENV WS_VERSION_CAT[1]=Websphere Version:ws7
I was expecting the output to be just ws7
Also, how do I access this variable in next step?
Thank you
One answer
Comments
I will try this approach, but why does it not work the way I have as mentioned in the link - Buildforge on-line help document ?
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`"