2017-06-26 84 views
0

我想在bash中使用case(在Jenkinsfile中)比較給定的值並對其採取行動。然而,case失敗,因爲:附近意外的標記'經理」語法錯誤附近的意外令牌

語法錯誤

錯誤發生在這裏:

... 
... 

def microServicesList = microServicesToUpdate.tokenize(",") 
... 
... 

for (String microserviceName : microServicesList) { 
    sh """ 
     ... 
     ... 

     case ${microserviceName} in 
      "Instances Manager")        
       // do something 
      ;; 
     esac 
    """ 
} 

回答

0

只好用雙引號括起來:

case "${microserviceName}" in 
相關問題