On Tuesday, Aug 23rd 2005 at 14:34 -0400, quoth Steven W. Orr:
=>40 Quatloos to the winner.
=>
=>Here's what I need:
=>
=>Look for a marker in a file and delete the line with the marker. Then insert
=>file2 at that location.
=>
=>I have
=>
=>sed '/MARKER/d' file
=>and I have
=>sed '/MARKER/r file2
> Look for a marker in a file and delete the line with the marker. Then
> insert file2 at that location.
sed -e '/MARKER/{
r /tmp/file2
d
}' file
--kevin
--
Kevin's new Elephant Memory Systems Tribute Page:
http://home.comcast.net/~kevin_d_clark/ems/
__
# echo This is the replacement line >/tmp/replacementFile
# cat
40 Quatloos to the winner.
Here's what I need:
Look for a marker in a file and delete the line with the marker. Then
insert file2 at that location.
I have
sed '/MARKER/d' file
and I have
sed '/MARKER/r file2' file
but I'd like to just put the two together in one sed command. (Two -e
options