I need to check a branch name for the ( sign. E.g. we have $(Build.SourceBranch) = "test(1)" . When I try to call my command "myCommand $(Build.SourceBranch)" it fails with something like /agent/_work/_temp/653563be-e452-4f06-a7a8-276aad30c025.sh: line 12: syntax error near unexpected token `( where line 12 is the line in the bash with myCommand.
还将由大韩民国在篮子里检查,分行名称不包含“(......)”,但当我试图核对该名称时,会发生yn误:
<编码> 重复“Branch:$(Build.SourceBranch)”和(Build.SourceBranch) gr-i(>)
将按原样印刷:
command: test(1) /agent/_work/_temp/653563be-e452-4f06-a7a8-276aad30c025.sh: line 12: syntax error near unexpected token
(
`
In my local bash the above grep command would just return the branch name.
Any ideas on how I could exit the bash without a syntax error in this case would be very helpful.
I not only tried echo also
if [ $(Build.SourceBranch) == "test(1)"] then echo "test " fi
with syntax error, tried also to convert the "(" in the string to some other string but unfortunately failed.
Eckard.