[SLUG] grep sed

Al Girling al at gcguk.demon.co.uk
Tue Feb 28 19:48:05 GMT 2006


On Tue, Feb 28, 2006 at 05:55:13PM GMT, John Allsopp wrote:
> > On Tue, Feb 28, 2006 at 03:20:06PM GMT, John Allsopp wrote:
> >> > Al said: John, I can see how you got this to work, but I'm
> >> > uncertain about what you were trying to do with the '| tee
> >> > out.txt' bit.  I can see how you'd use grep -l to find all the
> >> > files containing your string before passing that list to xargs
> >> > and doing some sed magic to change the old to new numbers.  Could
> >> > you explain where 'tee' fits in please?
> >>
> >> I've always been irritated by the > out.txt to redirect the output
> >> to a file, whereupon you can't see what's being output. | tee
> >> out.txt is a T junction, a stream splitter: the output goes to the
> >> file, but it also goes to stdout too.
> >
> > OK. Fair enough.  I guess it's just not my cup of tea!  Seems like
> > just creating superfluous files while watching lots of stuff
> > disappear of the top of your screen.
> >
> > A little puzzled,
> 
> Well, it created a lot of output, so what else would you do?

Sorry John, I'm not trying to be argumentative.

When I do these tasks, all I do is check the file in whatever software
it's written for or grep the strings I've changed to ensure my editing
was successful.

It seems to me that the task you described initially was finished after
sed had done it's work.  The creation of another file while passing the
same information to stdout seems a waste of time.

Even if you create an extra file you would still check the files you
have been working with to assure yourself they are correct.

Is it the way the unices show nothing unless an error occours that you
dislike?

Don't worry, after a while you'll get to like the lack of interference
from the system. :)

Al

-- 
Al Girling

Home page:                  <http://al.sdf-eu.org>
Linux User: #290080         <http://counter.li.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.lug.org.uk/pipermail/scarborough/attachments/20060228/da17f7ae/attachment.bin


More information about the Scarborough mailing list