Dado
oNe-oNE ; 2
one-too ; 1
One-TOO-pots-one-one ; 21
one-foo ; 1
então
awk -F\; '
BEGIN {
val["one"]=1;val["too"]=2;val["hello"]=4;val["pots"]=16;
}
{
split($1,a,"[- ]");
t = 0;
for (i in a) {
t += val[tolower(a[i])];
}
if (t == $2) print $0, "match"; else print $0, "not";
}' file
produz
oNe-oNE ; 2 match
one-too ; 1 not
One-TOO-pots-one-one ; 21 match
one-foo ; 1 match