diff options
| author | Ben Page <ben.page@openreign.com> | 2015-09-16 18:40:20 -0500 |
|---|---|---|
| committer | Ben Page <ben.page@openreign.com> | 2015-09-17 09:44:27 -0500 |
| commit | 7fe2c61ac3764865b784dcf34131358dba0d722d (patch) | |
| tree | e5aaa279d6541ade9f8df98fd6b5ce4a857183eb /packaging | |
| parent | ef60743ac759d49364feeb2312cd0d1bf11c5478 (diff) | |
| download | rabbitmq-server-git-7fe2c61ac3764865b784dcf34131358dba0d722d.tar.gz | |
fixed support for arguments containing ` characters
Diffstat (limited to 'packaging')
| -rw-r--r-- | packaging/common/rabbitmq-script-wrapper | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/packaging/common/rabbitmq-script-wrapper b/packaging/common/rabbitmq-script-wrapper index d348c6b385..f7b46fb913 100644 --- a/packaging/common/rabbitmq-script-wrapper +++ b/packaging/common/rabbitmq-script-wrapper @@ -15,19 +15,15 @@ ## Copyright (c) 2007-2015 Pivotal Software, Inc. All rights reserved. ## -# Escape spaces and quotes, because shell is revolting. SED_OPT="-E" if [ $(uname -s) == "Linux" ]; then SED_OPT="-r" fi for arg in "$@" ; do - # Escape quotes in parameters, so that they're passed through cleanly. - arg=$(sed $SED_OPT -e 's/(["$])/\\\1/g' <<-END - $arg - END - ) - CMDLINE="${CMDLINE} \"${arg}\"" + # Wrap each arg in single quotes and wrap single quotes in double quotes, so that they're passed through cleanly. + arg=`printf %s $arg | sed $SED_OPT -e "s/'/'\"'\"'/g"` + CMDLINE="${CMDLINE} '${arg}'" done cd /var/lib/rabbitmq |
