From bf89de71a23bb6b3df269b8fca4c95da5ec34b40 Mon Sep 17 00:00:00 2001 From: Michi Date: Wed, 18 Apr 2018 20:24:41 +0200 Subject: [PATCH] fixed escaping --- act.sh | 8 ++++---- helpers/apiCall.sh | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/act.sh b/act.sh index b12c282..db761ff 100755 --- a/act.sh +++ b/act.sh @@ -1,6 +1,6 @@ #!/bin/bash ACT_VERSION="v0.3.0" -ACT_LAST_COMMIT="1682ba551b5d65892f300b5a737b46e1c0f691af" +ACT_LAST_COMMIT="13b1692a909cb01fbf21c38ef46ac9950d92b7be" USER_CONFIG="$HOME/.appdynamics/act/config.sh" GLOBAL_CONFIG="/etc/appdynamics/act/config.sh" CONFIG_CONTROLLER_COOKIE_LOCATION="/tmp/appdynamics-controller-cookie.txt" @@ -60,7 +60,7 @@ function apiCall { do case "${opt}" in X) - METHOD=${OPTARG} + METHOD=${OPTARG} ;; d) PAYLOAD=${OPTARG} @@ -103,10 +103,10 @@ function apiCall { debug "Applying $opt with $ARG" # PAYLOAD=${PAYLOAD//\$\{${opt}\}/$OPTARG} # ENDPOINT=${ENDPOINT//\$\{${opt}\}/$OPTARG} - while [[ $PAYLOAD =~ \${$opt\??} ]] ; do + while [[ $PAYLOAD =~ \$\{$opt\??\} ]] ; do PAYLOAD=${PAYLOAD//${BASH_REMATCH[0]}/$OPTARG} done; - while [[ $ENDPOINT =~ \${$opt\??} ]] ; do + while [[ $ENDPOINT =~ \$\{$opt\??\} ]] ; do ENDPOINT=${ENDPOINT//${BASH_REMATCH[0]}/$ARG} done; done diff --git a/helpers/apiCall.sh b/helpers/apiCall.sh index d6f6cb8..a5c89bd 100755 --- a/helpers/apiCall.sh +++ b/helpers/apiCall.sh @@ -9,7 +9,7 @@ function apiCall { do case "${opt}" in X) - METHOD=${OPTARG} + METHOD=${OPTARG} ;; d) PAYLOAD=${OPTARG} @@ -57,10 +57,10 @@ function apiCall { debug "Applying $opt with $ARG" # PAYLOAD=${PAYLOAD//\$\{${opt}\}/$OPTARG} # ENDPOINT=${ENDPOINT//\$\{${opt}\}/$OPTARG} - while [[ $PAYLOAD =~ \${$opt\??} ]] ; do + while [[ $PAYLOAD =~ \$\{$opt\??\} ]] ; do PAYLOAD=${PAYLOAD//${BASH_REMATCH[0]}/$OPTARG} done; - while [[ $ENDPOINT =~ \${$opt\??} ]] ; do + while [[ $ENDPOINT =~ \$\{$opt\??\} ]] ; do ENDPOINT=${ENDPOINT//${BASH_REMATCH[0]}/$ARG} done; done