Re: [Exim] condition question

Página Inicial
Delete this message
Reply to this message
Autor: Sebastian Stark
Data:  
Para: exim-users
Assunto: Re: [Exim] condition question
Yann Golanski wrote:
> > I keep getting misplaced { }'s errors. Any thoughts/suggestions?
> Try vi (or vim) and shift+% that will match your brackets.
> ${if and {{${lookup mysql{select $${local_part}}}}}}


The following perl skript detects non matching braces:

---

#!/usr/bin/perl -w
$str = <STDIN>;
$c = 0;
for (split //, $str) {
$_ eq '{' && $c++;
$_ eq '}' && $c--;
$c lt 0 && die "Something's wrong (you closed a brace you never opened)\n";
};
print "$c (0 means o.k., positive value means you forgot $c closing braces)\n";

---

(not perfect, but useful for debugging)