[Asterisk-Users] How to quickly replace ', ' with '|' in dialplans?

Jeremy McDermond mcdermj at xenotropic.com
Sat Jun 4 16:15:57 MST 2005


On Jun 4, 2005, at 1:30 PM, kleis-asterisk-dev at tiscali.it wrote:

>> -- Messaggio Originale --
>> Date: Sat, 4 Jun 2005 14:52:42 -0400 (EDT)
>> From: Steve <asterisk at michiganbroadband.com>
>> To: Asterisk Users Mailing List - Non-Commercial Discussion  
>> <asterisk-users at lists.digium.com>
>> Subject: Re: [Asterisk-Users] How to quickly replace ',
>>     ' with '|' in dialplans?
>> Reply-To: Asterisk Users Mailing List - Non-Commercial Discussion  
>> <asterisk-users at lists.digium.com>
>>
>>
>>
>> I stink at regular expressions, but can always find what I need to  
>> get a
>>
>> job done using google :-)
>>
>> Don't use vi (unless you figure out how to do it in vi).
>> I won't be much help there.
>>
>> in this case sed is your friend.
>>
>> It's a breeze to use too.
>>
>> Here's what it looks like:  sed -e "s/text_to_find/text_to_replace/g"
>> inputfile > outputfile
>> and yup you can use the same name for both files to simply update the
>> file.
>>

You can do the same thing in vi:

:1,$s/text_to_find/text_to_replace/g

but sed works too.


>> Make sure you back it up first of course.
>>
>> Here's a link with some more examples using sed:
>> http://pegasus.rutgers.edu/~elflord/unix/sed.html
>>
>>
>> Hope this helps!
>>
>> Steve
>>
>>
>



More information about the asterisk-users mailing list