summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChris Bandy <cbandy@sittercity.com>2016-02-09 13:30:39 -0600
committerChris Bandy <cbandy@sittercity.com>2016-02-09 13:30:39 -0600
commit1d3093798ed77bcadf86524d127cd97f1d9c420e (patch)
tree04306ab64cc2065cc704d39f02f77b70ab5335e0 /scripts
parent0120438b9441e6c4c1d650bf03e9e4995d9cab83 (diff)
downloadrabbitmq-server-git-1d3093798ed77bcadf86524d127cd97f1d9c420e.tar.gz
Use basic regular expressions for sed portability
Diffstat (limited to 'scripts')
-rw-r--r--scripts/rabbitmq-env8
-rw-r--r--scripts/rabbitmq-script-wrapper7
2 files changed, 3 insertions, 12 deletions
diff --git a/scripts/rabbitmq-env b/scripts/rabbitmq-env
index 872e5492de..2a0d48085b 100644
--- a/scripts/rabbitmq-env
+++ b/scripts/rabbitmq-env
@@ -103,15 +103,11 @@ fi
##--- Set environment vars RABBITMQ_<var_name> to defaults if not set
-SED_OPT="-E"
-if [ $(uname -s) = "Linux" ]; then
- SED_OPT="-r"
-fi
-
rmq_normalize_path() {
local path=$1
- echo "$path" | sed $SED_OPT -e 's,//+,/,g' -e 's,(.)/$,\1,'
+ # Remove redundant slashes and strip a trailing slash
+ echo "$path" | sed -e 's#/\{2,\}#/#g' -e 's#/$##'
}
rmq_normalize_path_var() {
diff --git a/scripts/rabbitmq-script-wrapper b/scripts/rabbitmq-script-wrapper
index ed4c276e53..9623f01709 100644
--- a/scripts/rabbitmq-script-wrapper
+++ b/scripts/rabbitmq-script-wrapper
@@ -15,14 +15,9 @@
## Copyright (c) 2007-2015 Pivotal Software, Inc. All rights reserved.
##
-SED_OPT="-E"
-if [ $(uname -s) = "Linux" ]; then
- SED_OPT="-r"
-fi
-
for arg in "$@" ; do
# 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"`
+ arg=`printf %s "$arg" | sed -e "s#'#'\"'\"'#g"`
CMDLINE="${CMDLINE} '${arg}'"
done