Re: [gentoo-user] [OT] Use of sed

2009-06-24 Thread Paul Hartman
On Wed, Jun 24, 2009 at 9:49 AM, Renat Golubchyk wrote: > Man page is very short. Check the info pages for full documentation. > (Almost all tools from GNU userland have a short man page and a long > info page. At least that is what they say right at the bottom.) Also, I have these pages in my boo

Re: [gentoo-user] [OT] Use of sed

2009-06-24 Thread Renat Golubchyk
Am Wed, 24 Jun 2009 15:18:02 +0100 schrieb Peter Humphrey : > On Wednesday 24 June 2009 12:28:05 Alex Schuster wrote: > > > man sed answers your second question :) > > s/regexp/replacement/ > Attempt to match regexp against the pattern space. If successful, > replace that portion match

Re: [gentoo-user] [OT] Use of sed

2009-06-24 Thread Alex Schuster
Peter Humphrey writes: > On Wednesday 24 June 2009 12:28:05 Alex Schuster wrote: > > man sed answers your second question :) > > s/regexp/replacement/ > Attempt to match regexp against the pattern space. If successful, > replace that portion matched with replacement. The replacement may

Re: [gentoo-user] [OT] Use of sed

2009-06-24 Thread Peter Humphrey
On Wednesday 24 June 2009 12:28:05 Alex Schuster wrote: > man sed answers your second question :) s/regexp/replacement/ Attempt to match regexp against the pattern space. If successful, replace that portion matched with replacement. The replacement may contain the special characte

Re: [gentoo-user] [OT] Use of sed

2009-06-24 Thread Alex Schuster
Peter Humphrey writes: > I'm reduced to asking a newcomer's question: how can I make sed recurse > down a directory tree? find . -type f -exec sed -i 's/foo/bar/g' '{}' \; > And while I'm at it, how do I change the field > separator from / to enable me to search on that character? Well, just ch

Re: [gentoo-user] [OT] Use of sed

2009-06-24 Thread Neil Bothwick
On Wed, 24 Jun 2009 12:03:19 +0100, Peter Humphrey wrote: > Perhaps. I'm not at my best in the mornings :-( Same here, and it's always morning somewhere :( -- Neil Bothwick Windows artificial intelligence: Unable to FORMAT A: Having a go at C: signature.asc Description: PGP signature

Re: [gentoo-user] [OT] Use of sed

2009-06-24 Thread Peter Humphrey
On Wednesday 24 June 2009 10:56:43 Alan McKinnon wrote: > Possibly you were thinking of grep's recursion switch? Perhaps. I'm not at my best in the mornings :-( -- Rgds Peter

Re: [gentoo-user] [OT] Use of sed

2009-06-24 Thread Alan McKinnon
On Wednesday 24 June 2009 11:34:18 Peter Humphrey wrote: > 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

Re: [gentoo-user] [OT] Use of sed

2009-06-24 Thread Peter Humphrey
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. > >

Re: [gentoo-user] [OT] Use of sed

2009-06-24 Thread Arttu V.
On 6/24/09, Neil Bothwick wrote: > On Wed, 24 Jun 2009 00:48:07 +0100, Peter Humphrey wrote: >> 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 u

Re: [gentoo-user] [OT] Use of sed

2009-06-23 Thread Neil Bothwick
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. > And whi

Re: [gentoo-user] [OT] Use of sed

2009-06-23 Thread Roy Wright
On Jun 23, 2009, at 6:48 PM, Peter Humphrey wrote: Hello list, I'm reduced to asking a newcomer's question: how can I make sed recurse down a directory tree? And while I'm at it, how do I change the field separator from / to enable me to search on that character? maybe something like:

[gentoo-user] [OT] Use of sed

2009-06-23 Thread Peter Humphrey
Hello list, I'm reduced to asking a newcomer's question: how can I make sed recurse down a directory tree? And while I'm at it, how do I change the field separator from / to enable me to search on that character? I used to have a "SED and AWK" book, but it seems to have walked; and I can't see