Re: which command I should use to extract the matching part out

2011-12-19 Thread lina
On Tue, Dec 20, 2011 at 2:30 AM, Bob Proulx wrote: > lina wrote: >> Bob Proulx wrote: >> > lina wrote: >> >> aaa >> >> model 0 >> >> bbb >> >> ddd >> >> model 1 >> >> ccc >> >> >> >> I want to print out the parts which match the "model 0" and ends with >> >> match "model 1" >> >> >> >> for the fin

Re: which command I should use to extract the matching part out

2011-12-19 Thread Bob Proulx
Arno Schuring wrote: > lina (lina.lastn...@gmail.com on 2011-12-19 23:53 +0800): > > > sed -n '/^model 1/q;/^model 0/,$p' > > > > Just realize the sed -n '/model 0/,/model 1/'p can also do that. (so > > newbie I was/am). > > > > just still don't understand above sentence. sed -n '/^model > > 1/q

Re: which command I should use to extract the matching part out

2011-12-19 Thread Bob Proulx
lina wrote: > Bob Proulx wrote: > > lina wrote: > >> aaa > >> model 0 > >> bbb > >> ddd > >> model 1 > >> ccc > >> > >> I want to print out the parts which match the "model 0" and ends with > >> match "model 1" > >> > >> for the final expected output is: > >> > >> model 0 > >> bbb > >> ddd > > > >

Re: which command I should use to extract the matching part out

2011-12-19 Thread Arno Schuring
lina (lina.lastn...@gmail.com on 2011-12-19 23:53 +0800): > >  sed -n '/^model 1/q;/^model 0/,$p' > > Just realize the sed -n '/model 0/,/model 1/'p can also do that. (so > newbie I was/am). > > just still don't understand above sentence. sed -n '/^model > 1/q;/^model 0/,$p' The semicolon separa

Re: which command I should use to extract the matching part out

2011-12-19 Thread lina
On Fri, Dec 16, 2011 at 1:11 AM, Bob Proulx wrote: > lina wrote: >> aaa >> model 0 >> bbb >> ddd >> model 1 >> ccc >> >> I want to print out the parts which match the "model 0" and ends with >> match "model 1" >> >> for the final expected output is: >> >> model 0 >> bbb >> ddd > > Try this: > >  s

Re: which command I should use to extract the matching part out

2011-12-15 Thread lina
On Fri, Dec 16, 2011 at 1:11 AM, Bob Proulx wrote: > lina wrote: >> aaa >> model 0 >> bbb >> ddd >> model 1 >> ccc >> >> I want to print out the parts which match the "model 0" and ends with >> match "model 1" >> >> for the final expected output is: >> >> model 0 >> bbb >> ddd > > Try this: > >  s

Re: which command I should use to extract the matching part out

2011-12-15 Thread Bob Proulx
lina wrote: > aaa > model 0 > bbb > ddd > model 1 > ccc > > I want to print out the parts which match the "model 0" and ends with > match "model 1" > > for the final expected output is: > > model 0 > bbb > ddd Try this: sed -n '/^model 1/q;/^model 0/,$p' Bob signature.asc Description: Dig

which command I should use to extract the matching part out

2011-12-15 Thread lina
Hi, (sorry a bit off-list again, but I really found the list is an amazing place) Well, for aaa model 0 bbb ddd model 1 ccc I want to print out the parts which match the "model 0" and ends with match "model 1" for the final expected output is: model 0 bbb ddd I tried grep -A N "model 0" but