diff options
| author | Jean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr> | 2015-09-21 14:28:42 +0200 |
|---|---|---|
| committer | Jean-Sébastien Pédron <jean-sebastien.pedron@dumbbell.fr> | 2015-09-21 14:28:42 +0200 |
| commit | d93cfdbf961c25e8b9c23692273b4640ef1e0f58 (patch) | |
| tree | 22a86a04a9bd76cf74cf1e13c0151ad6d3b340e6 | |
| parent | 47f3e12953892d58426c38a43aa99fdbd59415de (diff) | |
| parent | 7fe2c61ac3764865b784dcf34131358dba0d722d (diff) | |
| download | rabbitmq-server-git-d93cfdbf961c25e8b9c23692273b4640ef1e0f58.tar.gz | |
Merge pull request #318 from ben-page/stable
Fixed support for arguments containing ` characters
| -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 |
