Search code examples
bashrundeck

What do the at-signs in Rundeck's @option.message@ example mean to bash?


The Rundeck docs give the example of defining a message option (parameter) which can then be referred to by the script in a number of ways, including

echo message=@option.message@ ;# replacement token

We use this syntax and it seems fine, but I have no idea what those two @s actually mean to bash; I can't find mention of anything beyond $@, or anything relevant for the "replacement token" in the comment.


Solution

  • Per the docs you linked, that is a "replacement token" handled by Rundeck. That is, Rundeck replaces the @...@ before passing the command to bash. Consequently, they don't mean anything to bash :) . Specifically, the docs say:

    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.

    So bash sees the temp file post-expansion, without the @...@ sequences and with their values as literal text.

    The docs also note that "If the option is blank or unset the token will be replaced with a blank string." Therefore, the whole @...@ sequence will disappear if a particular token is not defined.

    See also this section on script usage and this section on context variables in the docs.