diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2018-05-30 16:10:05 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2018-06-12 20:21:01 +0200 |
commit | 7e59b1e27f80a5d466913a3b9040ee82d1ae2e52 (patch) | |
tree | 08b5777d40923468cefe2fc455bd3f4233ea267b /scripts/logs.sh | |
parent | 77f771b0411d1d5bc92b757bad1bcbc18921e6b4 (diff) | |
download | sonarqube-7e59b1e27f80a5d466913a3b9040ee82d1ae2e52.tar.gz sonarqube-7e59b1e27f80a5d466913a3b9040ee82d1ae2e52.zip |
[scripts] declare bash function in portable fashion
Diffstat (limited to 'scripts/logs.sh')
-rwxr-xr-x | scripts/logs.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/logs.sh b/scripts/logs.sh index e023847fb8b..f5078ee47fa 100755 --- a/scripts/logs.sh +++ b/scripts/logs.sh @@ -23,11 +23,11 @@ DEFAULT_LOG="all" DEFAULT_LINES="25" LOGS="sonar web ce es" -function toLower() { +toLower() { echo "$1" | tr '[:upper:]' '[:lower:]' } -function checkLogArgument() { +checkLogArgument() { local logArg="$1" local lowerLogArg=$(toLower $logArg) @@ -45,7 +45,7 @@ function checkLogArgument() { exit 1 } -function buildTailArgs() { +buildTailArgs() { local logArg="$(toLower $1)" local logLines="$2" local res="" @@ -59,7 +59,7 @@ function buildTailArgs() { echo "$res" } -function doTail() { +doTail() { local logArg="$1" local logLines="${2:-"$DEFAULT_LINES"}" TAIL_ARG=$(buildTailArgs "$logArg" "$logLines") |