jenkins escape sed command
问题 Can someone escape this sed shell command in Jenkins groovy script for me? So hard. sh (""" sed "s/(AssemblyInformationalVersion\(\")(.*)(\")/\1${productVersion}\3/g" AssemblyInfoGlobal/AssemblyInfoGlobal.cs -r """) 回答1: The triple-double-quote ( """ ) string literal syntax allows for variable/expression substitution (interpolation), so the backslash ( \ ) is interpreted as a special character "escape". Since the first open paren is not such a special character, Groovy compilation fails. If