Ok I guess I need something that will do the following:
search for this line of code in /var/lib/asterisk/bin/retrieve_conf:
$engineinfo = engine_getinfo();
insert these two lines immediately following:
$engineinfo['engine']="asterisk";
$engineinfo['version']="1.6.2.11";
Thanks in advance,
Joe
You could do it like this
Add
-ifor modification in place once you confirm that it works.What does it do and how does it work?
First we tell sed to match a line containing your string. On that matched line we then will perform an
acommand, which is “append text”.The syntax of a sed
acommand isNote that the literal newlines are part of this syntax. To make it all one line (and preserve copy-paste ability) in place of literal newlines I used
$'\n'which will tell bash or zsh to insert a real newline in place. The quoting necessary to make this work is a little complex: You have to exit single-quotes so that you can have the$'\n'be interpreted by bash, then you have to re-enter a single-quoted string to prevent bash from interpreting the rest of your input.EDIT: Updated to append both lines in one append command.