8283f85926f62192df95f95c17fe96e53dfe415f chmalee Tue Dec 5 08:33:20 2017 -0800 Fixing file globbing bug in updateTimesDb.sh diff --git src/utils/qa/updateTimesDb.sh src/utils/qa/updateTimesDb.sh index a8bcaf5..202a972 100755 --- src/utils/qa/updateTimesDb.sh +++ src/utils/qa/updateTimesDb.sh @@ -120,30 +120,33 @@ tablesDev=($(hgsql -Ne "SHOW TABLES" $dbDev | sort | \ tee $dbDev.tables )) tablesBeta=($(hgsql -h mysqlbeta -Ne "SHOW TABLES" $dbBeta | sort | \ tee $dbBeta.beta.tables )) else tablesDev=($(hgsql -Ne "SHOW TABLES" $dbDev | sort)) tablesBeta=($(hgsql -h mysqlbeta -Ne "SHOW TABLES" $dbBeta | sort)) fi # Combine tables from Dev and Beta, then sort and make list unique tablesSortedUnique=$(echo "$(echo ${tablesDev[@]} ${tablesBeta[@]})" | \ tr ' ' '\n' | sort -u | grep -v 'hgFindSpec\|trackDb' | tr '\n' ' ') output=". DEV BETA\ntableName $dbDev $dbBeta\n" +# if there's errors, the *** is causing wildcard expansion, so disable globbing +set -f + for tbl in $(echo ${tablesSortedUnique[@]}) do # Underscores added between date and time to that way "column" command later on works correctly devUpdate=$(hgsql -Ne "SELECT UPDATE_TIME FROM information_schema.tables WHERE TABLE_SCHEMA='$dbDev' AND TABLE_NAME='$tbl'" \ | sed 's/ /_/g') betaUpdate=$(hgsql -h mysqlbeta -Ne "SELECT UPDATE_TIME FROM information_schema.tables WHERE TABLE_SCHEMA='$dbBeta' AND TABLE_NAME='$tbl'" \ | sed 's/ /_/g') # Can't have have completely empty entries or "column" won't work if [[ $devUpdate == "" ]] then devUpdate="." elif [[ $betaUpdate == "" ]] then betaUpdate="."