normal 0 false false false en-us x-none


 Delete all such lines from a file that contains the word “MCA”.

 

echo -e "Enter the pattern : \c"

read ptrn

cnt=0

for i in `ls -1`

do

 if [ -f $i ]

 then

  l=`grep -E $ptrn $i|wc -l`

  if [ $l -gt 0 ]

  then

   rm $i

   echo "$i is deleted....."

   fi

 fi

done

 

Output

Enter the pattern : mca

temp.sh is deleted.....

Request for Solution File

Ask an Expert for Answer!!
Application Programming: normal 0 false false false en-us x-none
Reference No:- TGS0161561

Expected delivery within 24 Hours