logo       

Post-grep-like operations: msg#00043

editors.sed.user

Subject: Post-grep-like operations


I am wanting to select lines containing 'fruit' or 'veg', and then carry out
some operation on them, say substitution X for a.

Eg.

fruit banana
fruit fly
meat beef
veg carrot

to

fruit bXnXnX
fruit fly
veg cXrrot

I am trying to do this in a sed file:

/fruit/b
/veg/b
d
s/a/X/g

using the grep like command in the one-liners document.

The last expression doesn't get carried out. I guess something is happening
with the buffer, but do not understand what. I can't find '/b' in the
documentation.

I am trying to avoid having to do multiple passes of the data, but maybe I
can't.

Any help much appreciated,

Rob




------------------------ Yahoo! Groups Sponsor --------------------~-->
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/I258zB/QnQLAA/TtwFAA/dkFolB/TM
--------------------------------------------------------------------~->

--

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/sed-users/

<*> To unsubscribe from this group, send an email to:
sed-users-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/







<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise