Buildforge: step can not be safed when using special characters
![](http://jazz.net/_images/myphoto/e1bb538bf02d262eb4beecd50867debc.jpg)
3 answers
![](http://jazz.net/_images/myphoto/e1bb538bf02d262eb4beecd50867debc.jpg)
I'm not exactly sure what you are doing or what you are seeing, but for variable expansion problems remember that the command will be parsed TWICE. Build Forge will take a pass at variable expansion and will attempt to expand variables for its own environment, and then the shell will take a variable expansion pass. If the shell starts another shell it will possibly take more variable expansion passes. To bypass the BF variable expansion try _NO_PREPARSE_COMMAND in the step. Otherwise double up any variable characters.
![](http://jazz.net/_images/myphoto/e1bb538bf02d262eb4beecd50867debc.jpg)
Hi Spencer, thanks for your quick response. Actually, all I want to do is call a Linux command (ls -asl) and modify the output by using awk. The command on my host system will show the following:
[root@jabulan-lp4 ~]# ls -asl | awk '{ print $5 }'
root
root
root
root
root
root
root
root
users
When trying to put this Linux command into the buildforge step, I can not save the step... It seems to be related to the awk part because the simple "ls -asl" is working. I'm trying to mask the '{ print $5 }'- expression like \'{ print $5 }\' but this is not helping...
[root@jabulan-lp4 ~]# ls -asl | awk '{ print $5 }'
root
root
root
root
root
root
root
root
users
When trying to put this Linux command into the buildforge step, I can not save the step... It seems to be related to the awk part because the simple "ls -asl" is working. I'm trying to mask the '{ print $5 }'- expression like \'{ print $5 }\' but this is not helping...
![](http://jazz.net/_images/myphoto/e1bb538bf02d262eb4beecd50867debc.jpg)
I've changed the environments to
and changed the environment in my library..not helping.
I've changed the masking..not helping...
After changing the command in the step and saveing the step, I would like to start the library but then I'm getting this message:
Strange...
![](https://jazz.net/forum/upfiles/Screenshot_-_11.12_1.jpg)
and changed the environment in my library..not helping.
I've changed the masking..not helping...
After changing the command in the step and saveing the step, I would like to start the library but then I'm getting this message:
![](https://jazz.net/forum/upfiles/Screenshot_-_11.12_2.jpg)
Strange...
Comments
![](http://jazz.net/_images/myphoto/409d02eda675fd53138414f477c2ec0b.jpg)
What exactly do you see in the step log when you escape the $5?
![](http://jazz.net/_images/myphoto/e1bb538bf02d262eb4beecd50867debc.jpg)
I can not run this modified step because I can not save it - I need to usue the ^for escaping. And not only the $ is the problem, the ' are causing trouble too. I can escape them using ^ but then the awk expression was producing an error:
184 12/11/12 10:30 AM ENV BF_USER_LOGIN=root 185 12/11/12 10:30 AM ENV BF_W=2 186 12/11/12 10:30 AM ENV LANG=C 187 12/11/12 10:30 AM ENV REMOTE_HOST=::ffff:9.27.29.43 188 12/11/12 10:30 AM ENV _NO_PREPARSE_COMMAND=1 189 12/11/12 10:30 AM EXEC spawning shell [/bin/bash] 190 12/11/12 10:30 AM SCRIPT lsscsi | awk ^'{ print $$4 }^' 191 12/11/12 10:30 AM EXEC start [/tmp/lsscsi/BUILD_10@jabulan-lp4.austin.ibm.com] 192 12/11/12 10:30 AM EXEC awk: ^{ print $$4 }^ 193 12/11/12 10:30 AM EXEC awk: ^ syntax error 194 12/11/12 10:30 AM EXEC end [/tmp/lsscsi/BUILD_10@jabulan-lp4.austin.ibm.com] 195 12/11/12 10:30 AM RESULT 1 (1)