[ale] who is the fastest bash scripter?

David S. Jackson dsj at sylvester.dsj.net
Tue Feb 25 20:05:00 EST 2003


On Tue, Feb 25, 2003 at 11:44:45AM -0500 Jason Day <jasonday at worldnet.att.net> wrote:
> On Tue, Feb 25, 2003 at 10:39:20AM -0500, Michael D. Hirsch wrote:
> > On Monday 24 February 2003 06:00 pm, David S. Jackson wrote:
> > > You know, you're calling an extra echo command and doing a conditional
> > > check (&&) when all you need to do is tell grep to include the filename
> > > in its printout.  (See the -H switch in man grep.)  No need to call any
> > > other utilities or spawn any other processes.
> > 
> > This doesn't sound right to me.  Since grep is reading from stdin in these 
> > scripts it can't possibly know the name of the file.
> 
> You're right.  I knew there was something wrong with using the -H switch
> in this circumstance, but I never went back and investigated why after
> David's post.  Also, if you don't care about grep's output, you can
> redirect it to /dev/null, and just get the name of the jar file.
> 
> Then again, if that's what you want, you could just do "grep -H *.jar".

Woops.  Sorry guys.  Forgot about STDIN there.  :-\

How about just using zgrep instead of calling tar or gunzip or whatever?

zgrep -H <classname> *.jar

-- 
David S. Jackson                        dsj at dsj.net
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
I think we're all Bozos on this bus.
		-- Firesign Theatre
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale






More information about the Ale mailing list