[asterisk-dev] Better pattern matching

Kristian Kielhofner kristian.kielhofner at gmail.com
Thu Aug 2 13:46:23 CDT 2007


On 8/2/07, Vasil Kolev <vasil at ludost.net> wrote:
>
> The problem is the bad habit creation... For example, you have a big
> config, and you start using this to simplify it - then it grows, grows,
> you try using grep and you're screwed.

  What about some use of "grep -A"?  Consider this:

exten => 100,1,()
exten => p,n,()
exten => p,n,()

grep -A2 100 /etc/asterisk/extensions.conf

returns the same thing as:

exten => 100,1,()
exten => 100,n,()
exten => 100,n,()

grep 100 /etc/asterisk/extensions.conf


> Or putting it shorter - there's no considerable gain from this (even
> will break formatting and make it a bit harder to read), and will create
> nice possibilities for abuse and problems...

  I don't agree.  I like it!

> I mean, easy grepability/parsebility with cmdline tools is probably one
> of the (not many :) ) plus sides of the current extensions language.
>

 The flexibility of command line tools and the ability to use stdin,
stdout, and pipes to combine them is one of the plus sides of a
UNIX-inspired operating system.


-- 
Kristian Kielhofner



More information about the asterisk-dev mailing list