'd' will delete all lines in this range: from the line matching
'replacefromhereon' and the end of the file ($). Note that the
above will only output the changes to the terminal. To actually
modify the file use the option '-i' (in place):
sed -i '/^replacefromhereon$/,$d'
Hope it helps.
On 02/17/[masked]:46 PM, mowgli 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
To learn more about mowgli, visit his/her member
To report this message or block the sender, please click
Set my mailing list to email me As
they are sent | In
one daily email | Don't
send me mailing list messages
POB 4668 #37895 NY NY USA 10163 | [address removed]