我想列出目录内容并在其他地方使用结果:
bundle agent test
{
commands:
"ls /tmp/test/";
reports:
ubuntu::
"print output here for example";
# or add it to a variable which is how I really want to use it.
}
我想列出目录内容并在其他地方使用结果:
bundle agent test
{
commands:
"ls /tmp/test/";
reports:
ubuntu::
"print output here for example";
# or add it to a variable which is how I really want to use it.
}
请参阅https://cfengine.com/manuals/cf3-solutions#Execresult-example
从版本 3.3.0 开始,您可以改用 lsdir() 函数。
阅读更多: https ://cfengine.com/manuals/cf3-Reference#Function-lsdir