Counting greps

 #!/bin/bash
 
if [ $# -eq 1 ]
  then
   echo "file log: $1 - num of occurrences: "
   grep -w "string to grep" $1 | wc -l
else
 echo "no args specified: insert a file name"
fi

Comments