On Wednesday 24 June 2009 02:36:08 Neil Bothwick wrote:
> On Wed, 24 Jun 2009 00:48:07 +0100, Peter Humphrey wrote:
> > I'm reduced to asking a newcomer's question: how can I make sed recurse
> > down a directory tree?
>
> You don't, that's not sed's job, which is to edit the text you give it.
>
> Use find to generate a list of files for sed to work on.

I'll do that. I was confused by a vague memory that there was a recursion 
flag somewhere, but I must have been mistaken.

> > And while I'm at it, how do I change the field
> > separator from / to enable me to search on that character?
>
> By using something else, you don't need to tell sed, it works it out for
> itself, just use something that isn't in your search string, : is a good
> candidate.

The man page makes no mention of that, and when I tried it anyway I got 
puzzling results, so I assumed it couldn't be done.

> Or you can escape the / as \/ but this quickly degenerates into the
> leaning matchstick appearance so beloved of Perl scripters. 

Horrors!

Thanks to all for the help. Maybe I should replace that text-book after all.

-- 
Rgds
Peter

Reply via email to