From: Thanh Ha Date: Thu, 16 Jan 2020 00:06:08 +0000 (-0500) Subject: Resolve shellcheck SC219[67] ?grep non-standard X-Git-Tag: v0.50.0~15 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F23%2F62823%2F3;p=releng%2Fglobal-jjb.git Resolve shellcheck SC219[67] ?grep non-standard 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 Change-Id: Ibbeb8d799c6c31b6706306c4760c371efde573c8 --- diff --git a/shell/jenkins-verify-images.sh b/shell/jenkins-verify-images.sh index a27efd83..d005c52f 100755 --- a/shell/jenkins-verify-images.sh +++ b/shell/jenkins-verify-images.sh @@ -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" diff --git a/shell/job-cost.sh b/shell/job-cost.sh index 0d0e55ea..d3ee81e8 100644 --- a/shell/job-cost.sh +++ b/shell/job-cost.sh @@ -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