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 usage和 this section on context variables在文档中。
关于bash - Rundeck 的 @option.message@ 示例中的 at 符号对 bash 意味着什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42283333/