title: Deleting a PARTICULAR word from a file using shell script
body: <p>Hi I am having a problem in deleting a particular set of words from a file using Shell script. Here goes my problem,<br>
  My file: group.dat<br>
  Sample lines<br>
  <strong>ADMIN<br>
  ADMINISTRATION<br>
  ADMINISTRATOR</strong><br>
  My Script: groupdel.sh</p>
  
  <pre><code>#!/bin/sh
  groupf="&lt;pathtofile&gt;/group.dat"
  tmp="&lt;pathtofile&gt;/te"
  delgrp()
  {
          echo "Enter the group to be deleted"
          read gname
          echo "-------------------"
          for gn in `cat $groupf`
          do
                  if [ "$gname" = "$gn" ]
                  then
                          sed -e "s/$gname//g" $groupf &gt; $tmp&amp;&amp;mv $tmp $groupf
                          echo "deleted group"
                          cat $groupf
                          exit 1
                  fi
          done
  }
  echo "Welcome to Group delete wizard"
  delgrp
  </code></pre>
  
  <p>Output: 
  Enter the group to be deleted  </p>
  
  <h2><strong>ADMIN</strong></h2>
  
  <p>deleted group  </p>
  
  <p>ISTRATION
  ISTRATOR</p>
  
  <p>Problem: My problem is I dont want the script to delete ADMINISTRATION or ADMINISTRATOR but to delete only ADMIN, any help how to achieve it.<br>
  Thanks in Advance</p>