Bash -c '...' in bootstrap templates

Hi,

I have noticed that all knife bootstrap templates bundled with Chef are
shell scripts wrapped in extra layer of “bash -c ‘…’”. Can anybody
here explain, what is the reason for this - some escaping magic I can’t
grasp now (it seems to just add one escape level, which rather makes
problems than solves them), is it related to sudo, or is it just to
make sure that bash is used in case distro provides a different login
shell?

Thanks,
– M

As I understand it is used to make sure that bash is used.

On Mon, Jul 16, 2012 at 4:41 PM, Maciej Pasternacki
maciej@pasternacki.netwrote:

Hi,

I have noticed that all knife bootstrap templates bundled with Chef are
shell scripts wrapped in extra layer of "bash -c '...'". Can anybody here
explain, what is the reason for this - some escaping magic I can't grasp
now (it seems to just add one escape level, which rather makes problems
than solves them), is it related to sudo, or is it just to make sure that
bash is used in case distro provides a different login shell?

Thanks,
-- M