0

bash スクリプトから puppet を呼び出そうとしていますが、動作中にスクリプトが途中で終了します。

#!/bin/bash

...

function runPuppetLocally()
{
    echo "...running Puppet locally"
    exec puppet agent --test
    echo "Puppet complete"
}
runPuppetLocally

Puppet が exit などを発行していて、スクリプトが終了していると思います。スクリプトを終了せずに呼び出す方法はありますか?

4

1 に答える 1

5

Why do you use exec? Read help exec:

Replace the shell with the given command.

Your script is replaced with the puppet. If you do not want it to replace your shell, call it normally, i.e.

puppet agent --test
于 2011-11-30T16:36:51.220 に答える