addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1linklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Re: [opensource-62] sed help

From: mowgli
Sent on: Tuesday, February 18, 2014 9:30 AM
Yup the \c option. It's like \a but replaces! Found late last nite. 

On Feb 18, 2014, at 8:48, Jarett Stevens <[address removed]> wrote:

You can do something like this:

sed -e '/replacefromhereon/,$d'  FILE | sed -e '$anewtexthere\nmorenewtexthere'

There's probably a way to do it in a single sed command, but the first one eats the appended lines too in my brief tests.


On Mon, Feb 17, 2014 at 10:46 PM, mowgli <[address removed]> wrote:
using sed (or awk or whatever is best/shortest command), how do i replace ALL the text from a matchedpattern to EOF in a file?

ie if the file is:

blahblahblah
moreblah
replacefromhereon
xxxx
.....
yyyy

and i want the file to be:

blahblahblah
moreblah
newtexthere
morenewtexthere.

except i wont know what all the text after "replacefromhereon" is.  so i need to replace from that matched pattern to EOF regardless of whats there.

how do i achieve in simplest way?




--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by mowgli ([address removed]) from Dallas Open Source Saturday.
To learn more about mowgli, visit his/her member profile
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]





--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Jarett Stevens ([address removed]) from Dallas Open Source Saturday.
To learn more about Jarett Stevens, visit his/her member profile
To report this message or block the sender, please click here
Set my mailing list to email me As they are sent | In one daily email | Don't send me mailing list messages

Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed]

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy