Re: grep question

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


Date: Sat, 30 Aug 2003 01:19:28 GMT

On Fri, 29 Aug 2003 23:26:49 GMT, Barry Margolin <barry.margolin@level3.com> wrote:
>
>
> In article <3F4FCAEE.9040400@yahoo.com>,
> Kevin Rodgers <ihs_4664@yahoo.com> wrote:
>>Kumar Sundaram 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
>>
>>
>>I don't know if it's a GNU extension, but:
>>
>>
>> grep -f /page/cr/file.ini $ablog_file
>
> I think -f is a GNU extension for grep and egrep, but it's standard for
> fgrep. And in his example, it looks like he only needs to do exact
> matches, so fgrep may actually be the command he wants.
>

On my linux, Barry, grep -f is an alias for fgrep.

Alan C

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


Relevant Pages

  • Re: regex back matching
    ... for matching IP addresses... ... egrep is a version of the Unix grep program that does regular ... two variant programs egrep and fgrep are available. ...
    (comp.lang.perl.misc)
  • Re: HOW using 1 files contents as info to delete the second files containing that pattern?
    ... >read next line as the pattern, search untill found (records match ... read next line in file as the pattern to search ... sounds like a job for grep of fgrep ...
    (comp.unix.shell)
  • Re: Searching text files
    ... The distinction between grep and fgrep has all but gone away, ... If you're constrained by disk I/O or CPU when you search, ... DeeDee, don't press that button! ...
    (comp.unix.admin)
  • fgrep on cygwin
    ... Can get it to operate through GNU Emacs 22.0.990.1 ... Try `fgrep --help' for more information. ... Igrep exited abnormally with code 123 at Sat Nov 03 12:03:53 ... "*Run `grep` PROGRAM to match REGEX in FILES..." ...
    (comp.emacs)
  • Re: Replacing GNU grep revisited
    ... > get freegrep fairly close to the performance of GNU's grep. ... There is at least one aspect of freegrep that doesn't even come ... close to GNU grep, fgrep. ... many people are making use of fgrep but... ...
    (freebsd-hackers)