write a shell script that deletes all lines containing a specified word in one or more files supplied as arguments to it.help is appreciated .thank you.
Assuming...
$ more file*
::::::::::::::
file1
::::::::::::::
apple
banana
::::::::::::::
file2
::::::::::::::
banana
cherry
::::::::::::::
file3
::::::::::::::
banana
durian
::::::::::::::
file4
::::::::::::::
banana
epal
Then removing a "common word" from those files
$ for i in `ls file*`
> do cat $i | grep -v banana > $i
> done
$ more file*
::::::::::::::
file1
::::::::::::::
apple
::::::::::::::
file2
::::::::::::::
cherry
::::::::::::::
file3
::::::::::::::
durian
::::::::::::::
file4
::::::::::::::
epal
Is this what you are looking for?
Is this a homework question?
Regards