From 4c33fa8dbddaa9d32450e786ddb466eb0efa5a0e Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Thu, 21 Jun 2018 17:21:07 -0400 Subject: [PATCH] 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 --- shell/jenkins-configure-clouds.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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" } -- 2.16.6