Re: grep question

From: Alan Connor (xxxxxx_at_xxxx.xxx)
Date: 08/29/03


Date: Fri, 29 Aug 2003 17:19:20 GMT

On Fri, 29 Aug 2003 11:13:27 -0500, Kumar Sundaram <ksundar@landsend.com> wrote:
>
>
> I am reading search strings for grep from a input file and using it in a
> shell script.
> How do I grep for multiple strings in the shell script.
>
> Example:
> Input file contains:
> zombie process
> BAD KEY
> FAILED_DUMP
>
> In script,
>
> for s in `cat /page/cr/file.ini`
> do
> grep "$s" "$ablog_file" |tail -n5>> "$file2
> done
>
> Thanks,
> KS
>
>

Perhaps:

while read line ; do

grep "$line" ......

done < /page/cr/file.ini

Alan C

-- 
  
   take control of your mailbox ----- elrav1 ----- http://tinyurl.com/l55a


Relevant Pages

  • Re: grep question
    ... > How do I grep for multiple strings in the shell script. ... > Input file contains: ...
    (comp.unix.shell)
  • grep question
    ... I am reading search strings for grep from a input file and using it in a ... How do I grep for multiple strings in the shell script. ... Input file contains: ...
    (comp.unix.shell)
  • Re: grep question
    ... >> How do I grep for multiple strings in the shell script. ... so fgrep may actually be the command he wants. ...
    (comp.unix.shell)
  • SUMMARY: shell script help
    ... if anyone knows a good shell script list id like to know. ... the solution was to to use the IFS variable, which i think tells cat to use ... i want to grab each line of an input file then break out the columns ...
    (SunManagers)
  • Re: [opensuse] UUID=>0x and LVM
    ... kernel-default, kernel-default-base, and kernel- ... echo "Sorry, couldn't remove module $module." ... I wouldn't be able to create a shell script quickly like that. ... But unfortunately, not 'grep', nor 'basename' are available in the fall back shell. ...
    (SuSE)