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

Steve asterisk at michiganbroadband.com
Sat Jun 4 17:08:51 MST 2005


Cool!!!!
Good to know!
I use the heck out of vi but by all means not a power user.

Thanks for that tidbit!

Steve







On Sat, 4 Jun 2005, Jeremy McDermond wrote:

> 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
>>> 
>>> 
>> 
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
>  http://lists.digium.com/mailman/listinfo/asterisk-users
>



More information about the asterisk-users mailing list