From 1f8d9d66d2d5ded92cd321e99449a7647cc3f55f Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 26 Jul 2018 06:38:02 -0600 Subject: [PATCH] Fix most problems found by ShellCheck. --- contrib/utilities/count_lines.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/contrib/utilities/count_lines.sh b/contrib/utilities/count_lines.sh index 7397a33375..1ef661811d 100755 --- a/contrib/utilities/count_lines.sh +++ b/contrib/utilities/count_lines.sh @@ -63,26 +63,26 @@ git checkout -q master -commits=`git log | \ - egrep '^commit ' | \ - perl -p -e 's/^commit //g;' | \ - perl -e '$i=0; while (<>) { ++$i; if ($i % 200 == 0) { print; } }'` +commits=$(git log | \ + grep -E '^commit ' | \ + perl -p -e 's/^commit //g;' | \ + perl -e '$i=0; while (<>) { ++$i; if ($i % 200 == 0) { print; } }') for commit in $commits ; do - git checkout -q $commit + git checkout -q "$commit" - date=`git log --date=short --format="%ad" -n 1` + date=$(git log --date=short --format="%ad" -n 1) - files_source=`find . -name '*.h' -or -name '*.cc' -or -name '*.cu' -or -name '*.cuh' -type f | \ - egrep -i -v '(tests|boost|umfpack|bundled)/'` - lines_source=`cat $files_source | wc -l` + files_source=$(find . -name '*.h' -or -name '*.cc' -or -name '*.cu' -or -name '*.cuh' -type f | \ + grep -E -i -v '(tests|boost|umfpack|bundled)/') + lines_source=$(cat $files_source | wc -l) - files_tests=`find . -name '*.h' -or -name '*.cc' -type f | \ - egrep -i -v '(boost|umfpack|bundled)/' | \ - grep tests/` - lines_tests=`cat $files_tests | wc -l` + files_tests=$(find . -name '*.h' -or -name '*.cc' -type f | \ + grep -E -i -v '(boost|umfpack|bundled)/' | \ + grep tests/) + lines_tests=$(cat $files_tests | wc -l) - echo $date $lines_source $lines_tests + echo "$date" "$lines_source" "$lines_tests" done git checkout -q master -- 2.39.5