problem using awk

Hi, Anyone know why i get this error?

+ awk -F, '{if($5=="x" && $6=="y" && $10=="z")print $0}' file.data
awk: syntax error near line 1
awk: bailing out near line 1

This is the output from a shell script that can be resumed like...

set -x
fich_dat=file.data
variable1=x
variable2=y
variable3=z
awk -F, \''{if($5=='\"$variable1\"' && $6=='\"$variable2\"' && $10=='\"$variable3\"')print $0}'\' $fich_dat

The most strange is that if i copy paste:
awk -F, '{if($5=="x" && $6=="y" && $10=="z")print $0}' file.data
in the unix console, it works.

The UNIX system is:
Sun Microsystems Inc. SunOS 5.9

Try this syntax :

set -x
fich_dat=file.data
variable1=x
variable2=y
variable3=z
awk -F, -v V1="$variable1" -v V2="$variable2" -v V3="$variable3" \
'{if($5==V1 && $6==V2 && $10==V3)print $0}' $fich_dat 

In case of error, try to use nawk instead of awk

Jean-Pierre.

merci! vous �tes une machine!

This code works:

nawk -F, -v V1="$variable1" -v V2="$variable2" -v V3="$variable3" '{if($5==V1 && $6==V2 && $10==V3)print $0}' $fich_dat

or a bit more terse:

nawk -F, -v V1="$variable1" -v V2="$variable2" -v V3="$variable3" '$5==V1 && $6==V2 && $10==V3' $fich_dat