Bash Search File for Pattern, Replace Pattern With Code that Includes Git Branch Name

前端 未结 1 404
说谎
说谎 2021-01-16 10:39

I have a README.md file where I\'d like to replace a text identifier {{CODESHIP_CODE}} with a line of code – specifically a build status image code snippet that

相关标签:
1条回答
  • 2021-01-16 11:02

    You can't use a replacement string that contains the unescaped delimiter. Escape the delimiters in the string, or switch to different ones.

    ${codeship_build_status////\\/} # escape
    # or
    s%{{CODESHIP_CODE}}%$codeship_build_status%g #
    

    Make sure the new delimiter isn't contained in the string.

    0 讨论(0)
提交回复
热议问题