Resolve shellcheck SC219[67] ?grep non-standard 23/62823/3
authorThanh Ha <zxiiro@gmail.com>
Thu, 16 Jan 2020 00:06:08 +0000 (19:06 -0500)
committerAnil Belur <abelur@linuxfoundation.org>
Thu, 16 Jan 2020 03:31:46 +0000 (03:31 +0000)
SC2196: egrep is non-standard and deprecated. Use grep -E instead.
SC2197: fgrep is non-standard and deprecated. Use grep -F instead.

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: Ibbeb8d799c6c31b6706306c4760c371efde573c8

shell/jenkins-verify-images.sh
shell/job-cost.sh

index a27efd8..d005c52 100755 (executable)
@@ -43,7 +43,7 @@ echo "Verifying that cloud has a master configuration file"
 for cloud in jenkins-config/clouds/openstack/*; do
   if [[ -f $cloud/cloud.cfg ]]; then
     # Get the OS_CLOUD variable from cloud config
-    if ! os_cloud=$(egrep "^OS_CLOUD=" "$cloud/cloud.cfg" | cut -d'=' -f2); then
+    if ! os_cloud=$(grep -E "^OS_CLOUD=" "$cloud/cloud.cfg" | cut -d'=' -f2); then
       os_cloud="vex"
     fi
     OS_CLOUD=$os_cloud verify_images "$cloud"
index 0d0e55e..d3ee81e 100644 (file)
@@ -29,7 +29,7 @@ fi
 if [[ -f stack-cost ]]; then
     echo "DEBUG: $(cat stack-cost)"
     echo "INFO: Retrieving Stack Cost..."
-    if ! stack_cost=$(fgrep "total: " stack-cost | awk '{print $2}'); then
+    if ! stack_cost=$(grep -F "total: " stack-cost | awk '{print $2}'); then
         echo "ERROR: Unable to retrieve Stack Cost, continuing anyway"
         stack_cost=0
     fi