From: Thanh Ha Date: Thu, 21 Jun 2018 21:21:07 +0000 (-0400) Subject: Use a more exact grep for fetching cfg options X-Git-Tag: v0.22.0~20^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=4c33fa8dbddaa9d32450e786ddb466eb0efa5a0e;hp=-c;p=releng%2Fglobal-jjb.git Use a more exact grep for fetching cfg options Use an exact grep command to fetch cfg options so that an option containing the same characters in another option does not get parsed accidently. Change-Id: I40f3fd883ab5245da35b911aef3fe9edbda88fe2 Signed-off-by: Thanh Ha --- 4c33fa8dbddaa9d32450e786ddb466eb0efa5a0e diff --git a/shell/jenkins-configure-clouds.sh b/shell/jenkins-configure-clouds.sh index 3f7dd6a5..ed03f5c3 100644 --- a/shell/jenkins-configure-clouds.sh +++ b/shell/jenkins-configure-clouds.sh @@ -63,7 +63,7 @@ get_cfg() { exit 1 fi - cfg=$(grep "${setting^^}" "$cfg_file" | tail -1 | awk -F'=' '{print $2}') + cfg=$(grep "^${setting^^}=" "$cfg_file" | tail -1 | awk -F'=' '{print $2}') cfg=${cfg:-"$default"} echo "$cfg" }