grep command

grep command

Post by John All » Wed, 13 Oct 1999 04:00:00



Hi:

I use the -f qualifier in grep alot.  It allows you to use a list to
grep for expressions in a file(s).  Eg,

grep -f list.dat file.dat

I'm finding with my DEC(COMPAQ) V4.0e version of unix that the -f list
file is limited to 400 records; otherwise, if that is exceeded, you
get a 'list too large' message.

Is there anything which I can set to enlarge that 400 threshold; or,
is there a workaround?

Thanks,

John L. Allen

 
 
 

grep command

Post by Barry Margoli » Wed, 13 Oct 1999 04:00:00




>Hi:

>I use the -f qualifier in grep alot.  It allows you to use a list to
>grep for expressions in a file(s).  Eg,

>grep -f list.dat file.dat

>I'm finding with my DEC(COMPAQ) V4.0e version of unix that the -f list
>file is limited to 400 records; otherwise, if that is exceeded, you
>get a 'list too large' message.

>Is there anything which I can set to enlarge that 400 threshold; or,
>is there a workaround?

Does the file contain regular expressions, or just fixed strings?  If
they're just fixed strings, try fgrep instead of grep; it may not have as
small a limit.  If it does, install GNU fgrep; I just tried it with 10,000
records and it worked.  However, GNU grep and egrep both complained
"Regular expression too big".

--

GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

grep command

Post by Alain Magloi » Wed, 13 Oct 1999 04:00:00




: >Hi:
: >
: >I use the -f qualifier in grep alot.  It allows you to use a list to
: >grep for expressions in a file(s).  Eg,
: >
: >grep -f list.dat file.dat
: >
: >I'm finding with my DEC(COMPAQ) V4.0e version of unix that the -f list
: >file is limited to 400 records; otherwise, if that is exceeded, you
: >get a 'list too large' message.
: >
: >Is there anything which I can set to enlarge that 400 threshold; or,
: >is there a workaround?

: Does the file contain regular expressions, or just fixed strings?  If
: they're just fixed strings, try fgrep instead of grep; it may not have as
: small a limit.  If it does, install GNU fgrep; I just tried it with 10,000
: records and it worked.  However, GNU grep and egrep both complained
: "Regular expression too big".

Ha! yes, this comes from GNU regex.c, if you want a bigger buffer you'd have
to change the "# define MAX_BUF_SIZE" to something bigger and recompile.
grep -F does not use the regular expression of GNU regex, so
you should be ok.

--
au revoir, alain
----
Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!

 
 
 

grep command

Post by Mike Faga » Wed, 13 Oct 1999 04:00:00



Quote:> Hi:

> I use the -f qualifier in grep alot.  It allows you to use a list to
> grep for expressions in a file(s).  Eg,

> grep -f list.dat file.dat

> I'm finding with my DEC(COMPAQ) V4.0e version of unix that the -f list
> file is limited to 400 records; otherwise, if that is exceeded, you
> get a 'list too large' message.

> Is there anything which I can set to enlarge that 400 threshold; or,
> is there a workaround?

This is a problem we had to work on with our DNS server that has more than
6000 files that we often have to search through to find information.  Try
something along the lines of this:

ls * | xargs grep <searchdata>

I may not have the exact command right - do a man on xargs for more
information.

Mike

 
 
 

grep command

Post by Ben Smithur » Thu, 14 Oct 1999 04:00:00





>> I use the -f qualifier in grep alot.  It allows you to use a list to
>> grep for expressions in a file(s).  Eg,

>> grep -f list.dat file.dat

>> I'm finding with my DEC(COMPAQ) V4.0e version of unix that the -f list
>> file is limited to 400 records; otherwise, if that is exceeded, you
>> get a 'list too large' message.

>> Is there anything which I can set to enlarge that 400 threshold; or,
>> is there a workaround?

> This is a problem we had to work on with our DNS server that has more than
> 6000 files that we often have to search through to find information.  Try
> something along the lines of this:

> ls * | xargs grep <searchdata>

> I may not have the exact command right - do a man on xargs for more
> information.

I think you misunderstood. John, if I'm understanding correctly, wants
to use a lot of regular expressions contained in list.dat on just one or
a few files.  Your solution is the reverse -- a single regex on a lot of
files (if I'm understanding you correctly).

--
Ben Smithurst            | PGP: 0x99392F7D


 
 
 

1. grep command .sh_history

Why can one not grep any string from a shell history file ?

TIA
--
==========================================
Rocke Robertson
PWGSC-GTIS-CPS
Voice (613) 748-4604
Fax   (613) 748-4843

==========================================

2. need help mounting scsi device

3. Help on a grep command

4. Proxy Arp question

5. grep command help!!

6. HELP! None of My PCMCIA Cards are detected

7. Grep command kicking my butt

8. session replication for clustered apache web servers

9. bug on grep command

10. problem with emacs' grep command

11. Grep command to query two words

12. Help with grep command

13. help on grep command