From 77f771b0411d1d5bc92b757bad1bcbc18921e6b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Lesaint?= Date: Wed, 30 May 2018 16:06:56 +0200 Subject: [PATCH] [scripts] don't use pattern matching operator unless needed --- scripts/editions.sh | 4 ++-- scripts/logs.sh | 8 ++++---- scripts/stop.sh | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/editions.sh b/scripts/editions.sh index 238b4837e2f..fadf5cbe03a 100755 --- a/scripts/editions.sh +++ b/scripts/editions.sh @@ -13,12 +13,12 @@ function checkEditionArgument() { local editionArg="$1" local lowerEditionArg=$(toLower $editionArg) - if [ "$lowerEditionArg" == "$DEFAULT_EDITION" ]; then + if [ "$lowerEditionArg" = "$DEFAULT_EDITION" ]; then return fi for t in $EDITIONS; do - if [ "$lowerEditionArg" == "$t" ]; then + if [ "$lowerEditionArg" = "$t" ]; then return fi done diff --git a/scripts/logs.sh b/scripts/logs.sh index 90e64b3f175..e023847fb8b 100755 --- a/scripts/logs.sh +++ b/scripts/logs.sh @@ -31,12 +31,12 @@ function checkLogArgument() { local logArg="$1" local lowerLogArg=$(toLower $logArg) - if [ "$lowerLogArg" == "$DEFAULT_LOG" ]; then + if [ "$lowerLogArg" = "$DEFAULT_LOG" ]; then return fi for t in $LOGS; do - if [ "$lowerLogArg" == "$t" ]; then + if [ "$lowerLogArg" = "$t" ]; then return fi done @@ -51,7 +51,7 @@ function buildTailArgs() { local res="" for t in $LOGS; do - if [ "$logArg" == "$DEFAULT_LOG" ] || [ "$logArg" == "$t" ]; then + if [ "$logArg" = "$DEFAULT_LOG" ] || [ "$logArg" = "$t" ]; then res="$res -Fn $logLines $SQ_HOME/logs/$t.log" fi done @@ -68,7 +68,7 @@ function doTail() { # check the script was called to avoid execute when script is only sourced script_name=$(basename "$0") -if [ "$script_name" == "logs.sh" ]; then +if [ "$script_name" = "logs.sh" ]; then LOG="$DEFAULT_LOG" LINES="$DEFAULT_LINES" EDITION="$DEFAULT_EDITION" diff --git a/scripts/stop.sh b/scripts/stop.sh index c0dd72d8dbb..8b94cd2d2a7 100755 --- a/scripts/stop.sh +++ b/scripts/stop.sh @@ -29,6 +29,6 @@ function stopAny() { # check the script was called to avoid execute when script is only sourced script_name=$(basename "$0") -if [ "$script_name" == "stop.sh" ]; then +if [ "$script_name" = "stop.sh" ]; then stopAny fi -- 2.39.5