【发布时间】:2015-02-12 05:30:32
【问题描述】:
我在 Jenkins(在 Linux 下)有一份工作,build parameter 类型为“Text”。我使用该参数来形成构建过程中使用的文件的内容,使用 bash “shell 执行”步骤,如 echo "$TEXTPARAM" > file。
如果有通用文本,它会很好地工作。但是当出现像“$”这样的字符时,它的行为就很奇怪了。
E. G。文字
Some $one and $$two and $$$more bucks and $ bucks $$ that $$$ stand alone and$ after$$ words$$$
变成了
Some $one and $two and $-sl bucks and $ bucks $ that $$ stand alone and$ after$ words$$
虽然我希望文本出现在文件中,就像它出现在输入文本框中一样。
这是 jenkins 中的错误(所以我应该向他们的跟踪器发布问题)还是我做错了什么?
更新
我想这是由于 Jenkins 完成了变量替换。即在执行任何“shell 执行”步骤之前,所有$VARNAMEs 都被 VARNAME 值替换。而这个替换 cannot be turned off 就目前而言。
【问题讨论】:
标签: bash parameters jenkins