在teamcity linux agent中的build步骤中运行grep

时间:2017-09-11 09:45:59

标签: linux teamcity

我在linux中运行我的teamcity代理。构建的第一步将使用命令行脚本获取包的版本,该脚本包含以下内容:

$versionNumber = grep "<Version>" %env.RelativeProjectPath% | sed -e "s/<[^>]*>//g"

问题是我收到此错误:

  

/ BuildAgent / temp / agentTmp / custom_script5887915083946808286:第1行:versionNumber =:找不到命令

为什么会发生这种情况或如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

使用此问题解决了问题:

versionNumber=$(grep '<Version>' %env.RelativeProjectPath% | sed -e 's/<[^>]*>//g')

相关问题