Thursday, 3 November 2016

( Shell Scripting ) Search a String in the file.

clear
if [ $# = 3 ]
then
   echo "Enter the file int this format---";
   echo "filename string";
 else
  echo "the no. of $1 occurences are ";
  grep -c $2 $1
fi

No comments:

Post a Comment