[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [RFR] templates://chef-solr/{chef-solr.templates}



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


Reply to: