I have the below script in my system:
#!/bin/sh LASTFILES=`find /var/log -mtime -1 -iname *.csv` KEYWORDS="MD AG GA" countMD="0" countAG="0" countGA="0" for i in $LASTFILES ; do for a in $KEYWORDS ; do count_$a=`grep -a $date $i | grep -i "\"$a\"" | grep smsMoBilling | wc -l` count$a=`expr $count$a + $count_$a` done done
It doesn't work when I run it.
./test.sh: line 35: count_MD=37: command not found expr: non-numeric argument ./test.sh: line 36: countMD=: command not found
What is the matter with the variable declared? Could you help me?