Browse Source

add check for illegal characters in filenames

Bill Gianopoulos 3 years ago
parent
commit
1d8ad2a21f
1 changed files with 7 additions and 1 deletions
  1. 7 1
      scripts/check_series.sh

+ 7 - 1
scripts/check_series.sh

@@ -16,12 +16,18 @@ for i in *
 do
 do
   if [ "$i" != "series" -a "$i" != "status" ]
   if [ "$i" != "series" -a "$i" != "status" ]
   then
   then
+    j=`echo $i | sed -e 's@[A-Za-z0-9_.-]@@g'`
+    if [ "$j" != "" ]
+    then
+      echo illiegal character\(s\) \'$j\' in filename \'$i\'
+      ERRORS=`expr $ERRORS + 1`
+    fi
     j=`echo $i | sed -e 's@\.@\\\.@g'`
     j=`echo $i | sed -e 's@\.@\\\.@g'`
     COUNT=`grep ^$j$ series | wc | sed -e 's@^\s*@@g' -e 's@ .*$@@g'`
     COUNT=`grep ^$j$ series | wc | sed -e 's@^\s*@@g' -e 's@ .*$@@g'`
     if [ "$COUNT" != "1" ]
     if [ "$COUNT" != "1" ]
     then
     then
       ERRORS=`expr $ERRORS + 1`
       ERRORS=`expr $ERRORS + 1`
-      echo $i appears $COUNT time in series
+      echo $i appears $COUNT times in series
     fi
     fi
   fi
   fi
 done
 done