On Fri, 26 May 2000, you wrote:
> On Fri, 26 May 2000, Karl J. Runge wrote:
> 
> > > >To tune your filesystem:
> > > >echo xmms>t;cat t|sed s/x/r/|sed s/ms/\ -f\ \\//|sed s/f/rf/>./t;sh./t -
> >                    ^                                              ^
> >                    |----------------------------------------------|
> > 
> > In general this wouldn't work since "t" would be clobbered before
> > cat opened it!
> 
> At first glance I initially thought the same, but modern shells stop
> dealing with shell metas at semis and pipes, and evaluate the commands in
> between in peices. For example:
> 
> $ echo j > junk; cat junk | sed "s/j/p/" > junk
> $ cat junk
> p
> $

WOW!  I've always assumed that the shell did all the plumbing up front (thereby
clobbering the input to the second part of the "list", in this case named junk).

I've warned MANY people against clobbering their input by using the same file
as ouput.  The sort(1) man page even goes out of its way to mention that the -o
option won't clobber an input file if it is alsp the output.  

I think I won't depend having a modern shell anytime soon.






> 
> I'm not so sure this would have worked on older implementations of the
> Bourne shell, but I don't have anything handy to test it on... :)
> 
> -- 
> Derek Martin
> System Administrator
> Mission Critical Linux
> [EMAIL PROTECTED] 
> 
> 
> **********************************************************
> To unsubscribe from this list, send mail to
> [EMAIL PROTECTED] with the following text in the
> *body* (*not* the subject line) of the letter:
> unsubscribe gnhlug
> **********************************************************
--
Standard is better than better.  If your web page cares what browser I'm using
it's broken.
[EMAIL PROTECTED]

**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************

Reply via email to