[ale] who is the fastest bash scripter?
Michael D. Hirsch
mhirsch at nubridges.com
Wed Feb 26 09:03:45 EST 2003
On Tuesday 25 February 2003 08:05 pm, David S. Jackson wrote:
> 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
Cool. I learned another new command, today. Thanks!
Michael
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale
More information about the Ale
mailing list