[Asterisk-Users] How to quickly replace ',
' with '|' in dialplans?
Iqbal
iqbal at gigo.co.uk
Sat Jun 4 15:58:10 MST 2005
perl -pi-e 's/\,/\|/g' filename
note this will not create a backup and will replace all ',' which might
not be what u want
this is run from the command line
Iqbal
On 6/4/2005, "kleis-asterisk-dev at tiscali.it"
<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.
>>
>>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
>>
>
>
>Just had a look at that links, and yes!, sed looks better than vi, thanks!
>:)
>Unfortunately I don't know regular expressions at all, so it doesn't help
>too much now... but I'll play with them.
>
>Thanks,
>
>Alex
>
>__________________________________________________________________
>TISCALI ADSL 1.25 MEGA a soli 19.95 euro/mese
>Solo con Tiscali Adsl navighi senza limiti di tempo
>a meno di 20 euro al mese e in piu' telefoni senza
>pagare il canone Telecom. Scopri come
>http://abbonati.tiscali.it/adsl/sa/1e25flat_tc/
>
>
>
>_______________________________________________
>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