添加 JBoss system-属性 前导零

Add JBoss system-property with leading zero

我正在尝试使用 JBoss CLI 添加 JBoss 系统-属性。

/system-property=variable.name:add(value=%{{{variablename}}})

%{{{variablename}}} 的值为“05”,但它截断了前导零,因此 system-属性 被设置为“5”。 我尝试使用 printf,但 CLI 不知道 printf 而 运行 命令:

/system-property=variable.name:add(value=`printf "%02d" %{{{variablename}}}`)

导致:

Failed to substitute printf "%02d" 05: No command handler for 'printf'.

关于如何将前导零输入系统的任何其他想法-属性?

好的,我已经设法通过在值中添加两个引号来做到这一点

/system-property=variable.name:add(value="%{{{variablename}}}")

我认为这是一个 bash 问题,这就是为什么我尝试使用 printf 而不是仅使用引号的解决方案。 The JBoss documentation about system-properties 遗憾的是没有提到这样的案例。