[TAG] 2c tip: filtering in-place
ben at callahans.org
Mon Mar 22 18:59:12 MSK 2004
On Mon, Mar 22, 2004 at 10:10:31AM -0500, Jay R. Ashworth wrote:
> On Sun, Mar 21, 2004 at 10:14:27PM -0500, Ben Okopnik wrote:
> > On Fri, Mar 19, 2004 at 01:44:22PM -0500, Jay R. Ashworth wrote:
> > >
> > > <interrupts self while raising hand to complain>
> > > Oh, cause buffer reads the entire file before the '>' can stomp it?
> > > Well, that's not *exactly* the same... :-)
> > Hell, Jay, by that standard of nitpickiness, nothing ever is. I mean,
> > all those microseconds have passed, many electrons have travelled some
> > distance in their orbit, we've moved along the direction indicated by
> > the entropy arrow...
> > The meaning of "exactly" for us humans always means "close enough".
> Well, in this case, my point was that I question whether it's "close
> enough", particularly to end up in a tip...
A number of folks I know, including myself (on the very rare occasion
that I need it) use the "buffer" method. [shrug] Seems to work fine in
> > > Doesn't that still depend on order of evaluation by the shell? Is that
> > > defined?
> > Well, *yeah* - just about as definitively as anything in Bash is.
> > Otherwise Kapil's method wouldn't work either. Neither would piping
> > anything through "sort". The left side of the pipe has to terminate
> > before the right side can do anything with the output; in many cases,
> > there _is_ no output until just before the left side terminates.
> In fact I think that's wrong: I don't think the dd method *does* depend
> on order of eval; the writing copy of dd can't try to write a block
> until it *has* it, so I believe that that method is *guaranteed* never
> to stomp data.
So interrupting the "reader" side of "dd" won't stomp anything, but the
writing side will - OK. I don't see a real difference (although I see a
theoretical one), particularly since I don't make a practice of pounding
"Ctrl-C" immediately after launching a buffered process.
> > Any conversation that includes "yeah, but csh..." is, in the parlance of
> > an acquaintance, "right off the bugfuck side of the spectrum."
> Three sigma West of ridiculous, yes. Did *I* mention csh? :-)
Nope. Just doing preventive maintenance. :)
> RFC 2100
Oh GHODS. Jay, you're an incarnation of Evil in the disguise of a
harmless geek. _And_ your scansion limps. :)))
* Ben Okopnik * okopnik.freeshell.org * Technical Editor, Linux Gazette *
-=-=-=-=-=o0o=-=-=-=-= <http://linuxgazette.net/> =-=-=-=-=o0o=-=-=-=-=-
More information about the TAG