bash - Rundeck 的 @option.message@ 示例中的 at 符号对 bash 意味着什么?

标签 bash rundeck

Rundeck docs给出定义 message 的示例选项(参数),然后脚本可以通过多种方式引用它,包括

echo <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="325f5741415355570f725d42465b5d5c1c5f574141535557" rel="noreferrer noopener nofollow">[email protected]</a>@ ;# replacement token

我们使用这种语法,看起来不错,但我不知道这两个 @ 是什么实际上意味着 bash;我找不到除 $@ 之外的任何内容,或评论中与“替换 token ”相关的任何内容。

最佳答案

the docs您链接的,这是 Rundeck 处理的“替换 token ”。也就是说,Rundeck 在将命令传递给 bash 之前替换了 @...@。因此,它们没有任何值得抨击的意思:)。具体来说,文档说:

Inline Script workflow steps that contain a token expansion will be expanded into a temporary file, and the temp file will contain the plaintext option value.

因此 bash 会看到临时文件扩展后,没有 @...@ 序列,它们的值作为文字。

文档还指出“如果选项为空或未设置,则 token 将被替换为空白字符串。”因此,如果未定义特定标记,整个 @...@ 序列将会消失。

另请参阅this section on script usagethis section on context variables在文档中。

关于bash - Rundeck 的 @option.message@ 示例中的 at 符号对 bash 意味着什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42283333/

相关文章:

arrays - 如何使用 bash 将数组的所有元素打印到文件中

bash - 如何使用 sudo 运行两个命令?

linux - diff 命令不起作用(参数麻烦)

linux - 将脚本中的所有命令 stdout/stderr 重定向到日志文件

java - 在 Java Rundeck Plugin 中添加对 jar 的依赖

linux - rundeck:辅助 sudo 密码身份验证不起作用

bash - 如何获取当前/又名下一次提交的 git 哈希(不是头)

mysql - Rundeck - 使用执行日志和缓存

bash - Rundeck 跨作业步骤共享变量

gradle - 如何从源代码(即github存储库)安装Rundeck?