Write a Shell script that deletes all lines containing a specified word in one or more files supplied as arguments to it.

AIM:

Write a  Shell script that deletes all lines containing a specified word in one or more files supplied as arguments to it.

Program:

## for this program we have to create one or more files (optional),
## I am creating two files names are del ,dell.

[root@localhost ~]#  vi del
unix is os
dos is also os
here using unix
unix is powerful os
~
 [root@localhost ~]#  vi dell
windowsnt is also os
there are some difference between unix and windowsnt
but unix is great among all os
## after creation two files now we have to write sed script file name is del.sed using vi editor.
[root@localhost ~]#  vi del.sed
{
  /os/d
}

Output:

[root@localhost ~]#  sed -f del.sed del dell

     here using unix

     there are some difference between unix and windowsnt