Fixing bash script bogosity - help?

Ignacio Vazquez-Abrams ivazqueznet at
Tue Apr 28 07:01:51 EDT 2009

On Tue, 2009-04-28 at 12:38 +0200, Martin Langhoff wrote:
> On Tue, Apr 28, 2009 at 12:03 PM, Ignacio Vazquez-Abrams
> <ivazqueznet at> wrote:
> > But if you're willing to let go of this futile quest to keep $CMD a
> > string then you'll find that it can be done:
> Your example doesn't work. I don't care about keeping $CMD as a
> string, I think you are misunderstanding the problem. We need to build
> it as a string to provide it as a single parameter value. This is
> because we want to run the command with all properly escaped params
> under runuser.

Which part of the following doesn't work?

        "$NAME" ejabberctl
        -pa "$EJABBER_EBIN"
        -s ejabber_ctl -extra "$ERLANG_NODE" "$@"
    if [ "$W" != "ejabberd" ]; then
        /sbin/runuser -s /bin/bash - ejabberd -c "${ERL_COMMAND[@]}"
        bash -c "${ERL_COMMAND[@]}"

    # replace remainder of function here

Ignacio Vazquez-Abrams <ivazqueznet at>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the Devel mailing list