Displaying 1 result from an estimated 1 matches for "appended_text1".
Did you mean:
  appended_text2
  
2008 Aug 31
2
Help using ed [OT]
...line(s) for text2
     .
     w
     q
EOF
done
Another example that solve the above problem. But this example become 
very easy unreadable if the appended text is long and/or includes 
linebreaks.
Example 2:
----------
for RFILE in $RLIST; do
ed - $RFILE << EOF
     g/text1/s//text1\\
     appended_text1/g
     g/text2/s//text2\\
     appended_text2/g
     w
EOF
done