From fe3697eaaae8d44527a7f59df2591673ad9c40fd Mon Sep 17 00:00:00 2001 From: "antoine.leveugle" Date: Wed, 25 May 2016 21:45:28 +0200 Subject: [PATCH] fix: assure compatibility with bash 4.0 and 4.1 closes #2 --- ovh-api-bash-client.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ovh-api-bash-client.sh b/ovh-api-bash-client.sh index c9a0897..1ac496d 100755 --- a/ovh-api-bash-client.sh +++ b/ovh-api-bash-client.sh @@ -203,7 +203,7 @@ getJSONFieldString() JSON="$1" FIELD="$2" RESULT=$(echo $JSON | $CURRENT_PATH/$LIBS/JSON.sh | grep "\[\"$FIELD\"\]" | sed -r "s/\[\"$FIELD\"\]\s+(.*)/\1/") - echo ${RESULT:1:-1} + echo ${RESULT:1:${#RESULT}-2} } main()