Re: grep question
From: Alan Connor (xxxxxx_at_xxxx.xxx)
Date: 08/30/03
- Next message: David: "rcs ci -m"
- Previous message: Barry Margolin: "Re: grep question"
- In reply to: Barry Margolin: "Re: grep question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: David: "rcs ci -m"
- Previous message: Barry Margolin: "Re: grep question"
- In reply to: Barry Margolin: "Re: grep question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|