Subject: | |
From: | |
Reply To: | Stigers, Gregory - ANDOVER |
Date: | Thu, 21 Aug 1997 13:50:16 -0400 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Does grep by default transverse subdirectories of the file arg? Can this
be changed?
Would find ./ -exec grep JOB {} also work for what is discussed below?
If you are grepping for job statements, I use grep !JOB
/ACCOUNT/JOBGROUPS/*. I haven't had that 'blow my buffer' yet.
>----------
>From: Mark Bixby[SMTP:[log in to unmask]]
>Sent: Thursday, August 21, 1997 12:52 PM
>To: [log in to unmask]
>Subject: Re: [HP3000-L] grep Segmentation violation on large filesets
>
>Eric J Schubert writes:
>>
>> Hi.
>>
>> Anyone know a workaround to this abort:
>>
>> ---
>> shell/iX> grep "JOB" ./*
>> **** Illegal instruction address (TRAPS 56).
>>
>> ABORT: GREP.HPBIN.SYS
>> [1] + Done (139) grep "JOB" ./*
>> 721117
>> Segmentation violation
>> grep
>> ----
>
>The "find" technique below will work, but it will recurse through all
>subdirectories, which may or may not be what you intend.
>
>Closer to your original intent would simply be:
>
> echo ./* | xargs grep "JOB"
>
>The shell rather than find generates the list of files in the current
>directory
>via wildcard expansion, then echo feeds the list of names into the xargs
>pipe,
>interatively calling grep passing a reasonable number of filename arguments
>each call.
>
>>
>> I tried a large stack when running the shell, still aborts.
>>
>> I searched the HP3000-L archive and Mark Bixby suggested using POSIX "find"
>> command feeding grep a file at a time (but not in response to grep
>> aborting) ...
>>
>> ---
>> POSIX grep will change the access date. The above scan in POSIX would be:
>>
>> find /ACCOUNT/GROUP | xargs grep -i "string"
>> ---
>>
>> This works on large counts of files --- gets around the seg violation
>>(above)
>>
>> Eric
>> ---
>> Eric J. Schubert, Senior Analyst
>> Excellence In Service - Office of Information Technologies
>> University of Notre Dame, Indiana USA 46556-5641
>>
>> Phone: (219) 631-7306
>> http://www.nd.edu/~eschuber
>> http://www.nd.edu/~eisteam
>>
>
>
>--
>Mark Bixby E-mail: [log in to unmask]
>Coast Community College Dist. Web: http://www.cccd.edu/~markb/
>District Information Services 1370 Adams Ave, Costa Mesa, CA, USA
>92626-5429
>Technical Support +1 714 438-4647
>"You can tune a file system, but you can't tune a fish." - tunefs(1M)
>
|
|
|