[ale] Bash question: | in find

Joe jknapka at earthlink.net
Sat Jan 25 03:15:06 EST 2003


Geoffrey <esoteric at 3times25.net> writes:

> Joe wrote:
> 
> > Why weird? We're telling echo not to put any newlines anywhere, so
> > unless and until "tar" spits out a result that doesn't go to stderr,
> > we get a huge list of files, all on one line.  The tar command isn't
> > going to emit a newline to stdout when it doesn't find the file we're
> > asking for, right?  So the "grep" spits out that line, and the last
> > file listed is the one containing the string.  Perhaps ksh emits a
> > newline after the tar command for some reason, and bash doesn't?
> 
> tar produces a newline after each entry it prints, thus I don't
> understand how it is that all the listed files coming from tar are
> suddenly listed on one file.

But this list isn't coming from tar; it's coming from find+echo.  Only
if tar finds a file that matches the given pattern in one of the list
or archives produced by find will it produce any non-error output.

Cheers,

-- Joe
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale






More information about the Ale mailing list