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

Re: [opensource-62] sed help

From: Jarett S.
Sent on: Tuesday, February 18, 2014 8:47 AM
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:


and i want the file to be:


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]

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