Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Elements$
- 3
- 1
- 5
- 7
- $EndElements$
- 1 65 71
- 2 32 87
- 3 39 98
- 4 41 63
- $Elements$
- 1 65 71
- 2 32 87
- 3 39 98
- 4 41 63
- $EndElements$
- lead='^$Elements$$'
- tail='^$EndElements$$'
- # f2 is the file where the information
- # to replace is kept in
- sed -e "/$lead/,/$tail/{ /$lead/{p; r insert_file
- > }; /$tail/p; d }" f2
- echo -e '/$Elements$/+1,/$EndElements$/-1dn.-1r f2nw' | ed -s f1
- sed -e "
- /$lead/,/$tail/!b
- //!d
- /$lead/r f2
- " f1
- $Elements$
- 1 65 71
- 2 32 87
- 3 39 98
- 4 41 63
- $EndElements$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement