On Jun 4, 2005, at 1:30 PM, [EMAIL PROTECTED] wrote:
-- Messaggio Originale --
Date: Sat, 4 Jun 2005 14:52:42 -0400 (EDT)
From: Steve <[EMAIL PROTECTED]>
To: Asterisk Users Mailing List - Non-Commercial Discussion
<[email protected]>
Subject: Re: [Asterisk-Users] How to quickly replace ',
' with '|' in dialplans?
Reply-To: Asterisk Users Mailing List - Non-Commercial Discussion
<[email protected]>
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
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users