<div dir="ltr">On Tuesday, 20 August 2013 14:27:15 UTC+8, Kal Sze  wrote:<br><blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr"><div>Hello,</div><div><br></div><div>I have RabbitMQ running on Ubuntu 12.04 and Debian Wheezy</div>I'm trying to setup some RabbitMQ users with secure passwords, but it looks like some characters don't get escaped correctly:<div><br></div><div><font face="courier new, monospace">&nbsp; &nbsp; root@server:~# rabbitmqctl add_user foo "\`"</font></div><div><font face="courier new, monospace">&nbsp; &nbsp; sh: 1: Syntax error: EOF in backquote substitution</font></div><div><br></div><div>Best Regards,</div><div>Kal</div></div></blockquote><div><br></div><div>After obtaining some help from the #bash channel on Freenode IRC, it appears that the correct fix would be to use proper string substitution in the <font face="courier new, monospace">rabbitmqctl</font><font face="arial, sans-serif"> </font>script:</div><div><br></div><div>Replace this line:\</div><div><font face="courier new, monospace">&nbsp; &nbsp;&nbsp;su rabbitmq -s /bin/sh -c "/usr/lib/rabbitmq/bin/${SCRIPT} ${CMDLINE}"</font></div><div><br></div><div>With this line:</div><div><font face="courier new, monospace">&nbsp; &nbsp; su rabbitmq -s /bin/sh -c 'script=$1; shift; "$script" "$@"' _ "/usr/lib/rabbitmq/bin/${SCRIPT}" "$@"</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">Credit goes to user zendeavor of the #bash channel on Freenode IRC.</font></div><div><br></div><div>Best Regards,</div><div>Kal</div></div>