[lammps-users] problem with if

I have a problem with the following if construct:

variable sn equal y[1]
fix dumpbrd all print 1 "\{sn\}&quot; file out\.dat if &quot;\({sn} < -1.0)" then "print 'out on sn'"

the variable sn is always correctly evaluated and outputted
but the if condition does not work (also when it is indeed met).

Thanks for any help,

It works for me. Have you tried the last statement
without the if (just print) to see what the value of sn
is at that point in time?