<div class="gmail_quote">On Tue, May 17, 2011 at 4:21 PM, satish patel <span dir="ltr"><<a href="mailto:satish_lx@hotmail.com">satish_lx@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
Hey Guys! <br><br>Sorry i am posting scripting question in asterisk forum but i had no choice. also i am not script expert so i though anyone here might help me. <br><br>following is my example sip.conf now i want to add accountcode="<callerid_name>" for example accountcode="Katie Wilson" in entire file. we have around 200 extension could someone help me to figure out how to do that with perl script or shell would be fine.<br>
<br>[100](seb-exten)<br>callerid="Katie Wilson" <100><br>mailbox=100@default<br><br>[200](seb-exten)<br>callerid="Ramona Minero" <200><br>mailbox=200@default<br></div></blockquote><div><br>
</div><div>Satish,</div><div><br></div><div>Give this a shot:</div><div><br></div><div>cat sip.conf | perl -pi -e "s/^callerid=\"(.*)\" <(.*)>/callerid=\"\$1\" <\$2>\naccountcode=\"\$1\"/" > sip.conf.new </div>
<div><br></div><div>and compare them.</div><div> </div></div>