fix a couple of issues in shell scripts found by codacy.

This commit is contained in:
Matthias Krüger 2016-12-25 00:43:47 +01:00
parent 00fd38967f
commit ecc91ba914
6 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
#/bin/sh
#!/bin/sh
xsltproc -o manual.html /usr/share/xml/docbook/stylesheet/nwalsh/xhtml/docbook.xsl manual.docbook

View File

@ -2,7 +2,7 @@
set -e # abort on error
set -x # be verbose
if [[ `pwd` == */test/cfg ]] ; then # we are in test/cfg
if [[ $(pwd) == */test/cfg ]] ; then # we are in test/cfg
CPPCHECK="../../cppcheck"
DIR=""
else # assume we are in repo root

View File

@ -1,4 +1,4 @@
#!/bin/bash
if [[ "`./cppcheck --showtime=top5 cli/cmdlineparser.h --quiet | wc -l`" != 7 ]] ; then
if [[ "$(./cppcheck --showtime=top5 cli/cmdlineparser.h --quiet | wc -l)" != 7 ]] ; then
false
fi

View File

@ -1,3 +1,3 @@
#!/bin/bash
cat $1 | sed s@\"@\\\\\"@g | sed s@^@\"@ | sed s@\$@\\\\n\"@ | sed 's@\t@ @g'
sed s@\"@\\\\\"@g | sed s@^@\"@ $1 | sed s@\$@\\\\n\"@ | sed 's@\t@ @g'

View File

@ -10,7 +10,7 @@
rm times-tags.txt
for i in `seq $1 $2`;
for i in $(seq $1 $2);
do
echo "1.$i"
echo "1.$i" >> times-tags.txt

View File

@ -15,12 +15,12 @@ make clean
git reset --hard HEAD > times.log
for i in `seq 1 50`; do
git_head=`git log -1 --format=%h`
for i in $(seq 1 50); do
git_head=$(git log -1 --format=%h)
# if build fails, make clean and try again
make SRCDIR=build CXXFLAGS=-O2 -j4 || make clean ; make SRCDIR=build CXXFLAGS=-O2 -j4
echo "Run number $i"
for j in `seq 1 ${iterations}`; do
for j in $(seq 1 ${iterations}); do
./cppcheck --quiet --showtime=summary --enable=all --inconclusive src 2> /dev/null | tee -a times.log
done
grep "Overall" times.log | tail -${iterations} | sed s/s// | awk -v "i=$i" -v "iterations=$iterations" -v "git_head=$git_head" '{ sum+=$3} END {print "Run " i", "git_head " Average: " sum/iterations}' | tee -a times.log