1 |
On Wednesday 24 June 2009 02:36:08 Neil Bothwick wrote: |
2 |
> On Wed, 24 Jun 2009 00:48:07 +0100, Peter Humphrey wrote: |
3 |
> > I'm reduced to asking a newcomer's question: how can I make sed recurse |
4 |
> > down a directory tree? |
5 |
> |
6 |
> You don't, that's not sed's job, which is to edit the text you give it. |
7 |
> |
8 |
> Use find to generate a list of files for sed to work on. |
9 |
|
10 |
I'll do that. I was confused by a vague memory that there was a recursion |
11 |
flag somewhere, but I must have been mistaken. |
12 |
|
13 |
> > And while I'm at it, how do I change the field |
14 |
> > separator from / to enable me to search on that character? |
15 |
> |
16 |
> By using something else, you don't need to tell sed, it works it out for |
17 |
> itself, just use something that isn't in your search string, : is a good |
18 |
> candidate. |
19 |
|
20 |
The man page makes no mention of that, and when I tried it anyway I got |
21 |
puzzling results, so I assumed it couldn't be done. |
22 |
|
23 |
> Or you can escape the / as \/ but this quickly degenerates into the |
24 |
> leaning matchstick appearance so beloved of Perl scripters. |
25 |
|
26 |
Horrors! |
27 |
|
28 |
Thanks to all for the help. Maybe I should replace that text-book after all. |
29 |
|
30 |
-- |
31 |
Rgds |
32 |
Peter |