Re: [gentoo-user] Re: Grep question

2009-03-06 Thread Etaoin Shrdlu
On Friday 6 March 2009, 00:01, Adam Carter wrote: > > > awk '/^foo/,/^bar/' a > > > > > > does the same :) > > > > Nice... > > Thanks for all these answers. Interesingly when I moved the sed script > (sed "s/;/\\n/g") from Linux to Solaris it failed as Solaris sed > doesn't like putting the newline

RE: [gentoo-user] Re: Grep question

2009-03-05 Thread Adam Carter
> > awk '/^foo/,/^bar/' a > > > > does the same :) > > Nice... Thanks for all these answers. Interesingly when I moved the sed script (sed "s/;/\\n/g") from Linux to Solaris it failed as Solaris sed doesn't like putting the newline character as the "translated to" bit. Installing GNU sed on the

[gentoo-user] Re: Grep question

2009-03-05 Thread Harry Putnam
Etaoin Shrdlu writes: > On Tuesday 3 March 2009, 03:10, Harry Putnam wrote: > >> cat a | awk '/^foo/{FLAG=1}\ >> FLAG{print} \ >> /^bar/{FLAG=""}' > > awk '/^foo/,/^bar/' a > > does the same :) Nice...

Re: [gentoo-user] Re: Grep question

2009-03-03 Thread Etaoin Shrdlu
On Tuesday 3 March 2009, 03:10, Harry Putnam wrote: > cat a | awk '/^foo/{FLAG=1}\ > FLAG{print} \ > /^bar/{FLAG=""}' awk '/^foo/,/^bar/' a does the same :)

[gentoo-user] Re: Grep question

2009-03-02 Thread Harry Putnam
James writes: > Adam Carter optus.com.au> writes: > > >> I need to select all >> the lines between string1 and string2 in a file. String1 exists on > an entire >> line by itself and string2 will be at the start of a line. What's > the syntax? I >> cant use -A as there is a variable number o

[gentoo-user] Re: Grep question

2009-03-02 Thread James
Adam Carter optus.com.au> writes: > I need to select all > the lines between string1 and string2 in a file. String1 exists on an entire > line by itself and string2 will be at the start of a line. What's the syntax? I > cant use -A as there is a variable number of lines. AWK is my vote. O