Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 Jenkins 作业,其中 1 个字符串参数 ($BRANCH) 默认设置为“分支/阶段/功能”。单个构建步骤是执行 Shell..
set +x echo ${BRANCH////_}
它因“错误替换”而失败
我正在尝试用下划线替换所有正斜杠并将其保存到新字符串中。
在 bash 中运行我在脚本顶部添加了 #!/bin/bash
#!/bin/bash set +x echo ${BRANCH////_}