Posted By

szpunk on 11/08/13


Tagged

bashreplace


Versions (?)

替换两行之间的内容 replace content between two line


 / Published in: Bash
 

line1=[aaaa] content line2=[bbbb]

let "0000" repalce the content.

  1. v='oooo';sed -n '/^\[aaaa\]/{p;:a;n;H;/^\[bbbb]/!ba;x;s/.*/'"$v"'/;G;};p'

Report this snippet  

You need to login to post a comment.