Hi,

Justin B Rye wrote:

>     RabbitMQ's rabbitmqctl program, which will be used to set this password,
>     cannot read input from a file. Instead the password will be passed to it
>     as a quoted string, so it must not include any shell special characters
>     (such as the exclamation mark) which will cause errors.

In theory, it should be possible to pass arbitrary special characters
to a program through a Bourne-style shell by surrounding the argument
with single-quotes and replacing each ' with '\'' and each ! with
'\!'.  Like so:

 arg_for_string () {
        printf '%s\n' "$1" |
        sed -e "
                s/'/'\\\\''/g
                s/^/'/
                s/\$/'/
        "
 }

 read arg
 arg=$(arg_for_string arg)
 printf 'Commandline: arg %s\n' "$arg"

Maybe doing so could allow the debconf prompt to be simplified.  Is
there a bug filed about that?

Hope that helps,
Jonathan

_______________________________________________
Pkg-ruby-extras-maintainers mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-ruby-extras-maintainers

Reply via email to