Search String

Hi I have a file with multiple fields,

I want to search for two strings "DONOTUSE" and "DO NOT USE" from the first field.

Cand anyone help me how to do this...

Thnks,
Ajith

Here is a sample script. It checks for the existence of one of two five-character strings to match. If found on a line, will echo the line to the screen (you can do whatever you want with the echo). Also, I am setting the lines (al_pr1 & al_pr2) separately since it is unclear to me exactly how you want to match. (You mention field 1, but without a sample file it is difficult to determine how to define/match your first field. Lastly, I use in my sample the file called alarms, but you can use anything you want at that point.

#! /bin/bash

al_fl1="MULCT"
al_fl2="JUNCT"
while read alt
do
al_pr1=$(echo $alt | grep $al_fl1)
al_pr2=$(echo $alt | grep $al_fl2)
if [ -n al_pr1 -o -n al_pr2 ]
then
echo "$alt"
fi
done < alarms