Shell script delete all lines from file contains word mca, Programming Languages

Assignment Help:

 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.....


Related Discussions:- Shell script delete all lines from file contains word mca

Just in time compiler, Expertsmind brings you  unique  solution in java as...

Expertsmind brings you  unique  solution in java assignments Just in Time Compiler In processing, just-in-time system (JIT), also known as energetic interpretation, is a m

Dbms, 2. Design an ER diagram for an IT training group database that will m...

2. Design an ER diagram for an IT training group database that will meet the information need’training programme. Clearly indicate the entities, relationships and the key constrain

C++ language introduces, C++ language introduces object-oriented programmin...

C++ language introduces object-oriented programming (OOP) features to C language. It offers classes, which provide the four features commonly present in OOP (or some non-OOP) langu

Improved application deployment, Improved Application Deployment Data sourc...

Improved Application Deployment Data source implementation is perhaps the key to any Asp.net program implementation, and, if the database implementation is easily done, there is an

Systems of differential equations, In this section we need to take a brief ...

In this section we need to take a brief look at systems of differential equations which are larger than 2 x 2. The problem now is not like the first few sections where we looked at

Laplace transforms, There actually isn't all that much to this section. All...

There actually isn't all that much to this section. All we are going to do now is work a quick illustration using Laplace transforms for a 3 rd order differential equation therefo

C.., I am still waiting on a quote from you

I am still waiting on a quote from you

Find the general solution, Example : Find the general solution to the subse...

Example : Find the general solution to the subsequent differential equation. x 2 y′′ - 7 xy′ + 16 y= 0   Solution First the roots of (3)  r (r -1) - 7r + 16= 0 r 2

insertion sort algortihm, Define a higher order version of the insertion s...

Define a higher order version of the insertion sort algortihm. That is define functions insertBy :: Ord b => (a->b) -> a -> [a] -> [a] inssortBy :: Ord b => (a->b) -> [a] ->

Lexical analyzer - xml table output, Lexical Analyzer: Symbol Table - Ho...

Lexical Analyzer: Symbol Table - Holds the symbols accepted by the lexical analyzer or parser.  Each symbol may be a terminal or a non-terminal.  Terminal symbols are listed

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd