Browse Source

tweak check_series.sh

Bill Gianopoulos 3 years ago
parent
commit
17e169b155
1 changed files with 10 additions and 4 deletions
  1. 10 4
      scripts/check_series.sh

+ 10 - 4
scripts/check_series.sh

@@ -1,17 +1,23 @@
 #!/bin/bash
 ERRORS=0
-pushd $1
+if [ "$1" = "" ]
+then
+  pushd . >/dev/null
+else
+  pushd $1 >/dev/null
+fi
 if [ ! -f series ]
 then
   echo no series file found
-  popd
+  popd >/dev/null
   exit 1
 fi
 for i in *
 do
   if [ "$i" != "series" -a "$i" != "status" ]
   then
-    COUNT=`grep ^$i$ series | wc | sed -e 's@^\s*@@g' -e 's@ .*$@@g'`
+    j=`echo $i | sed -e 's@\.@\\\.@g'`
+    COUNT=`grep ^$j$ series | wc | sed -e 's@^\s*@@g' -e 's@ .*$@@g'`
     if [ "$COUNT" != "1" ]
     then
       ERRORS=`expr $ERRORS + 1`
@@ -28,7 +34,7 @@ do
     echo $i
   fi
 done
-popd
+popd >/dev/null
 if [ "$ERRORS" = "0" ]
 then
   echo no errors detected