Re: [Exim] condition question

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Sebastian Stark
Date:  
À: exim-users
Sujet: 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)