integer treated as text?

The following script should kill all the queries taking more than say 600 seconds. But it seems that it is killing queries taking more than 6 seconds.

>> sh myscript.sh 600

#!/bin/bash
#kill runaway processes
SEC=$1
ifs='|'
if [[ $SEC -lt 1 ]]; then
echo "Usage: $0 seconds"
exit 1
fi
mysqladmin processlist -v | grep Query | grep -Evi "delete|update|insert|alter table" | while read dummy qid qusr qhost qdb qstat qsec qstat2 query
do
  if [[ $qsec > $SEC ]]; then
    echo "Killing query $qid..."
    mysqladmin kill $qid
  fi
done
if [[ $qsec > $SEC ]]

should be:

if [[ $qsec -gt $SEC ]]

Now I get the following error:

highprocess.sh: line 11: [[: |: syntax error: operand expected (error token is "|")

What is the value of $qsec?
Try to print the variable before the do loop or run the script with:

bash -x script-name

Your code did work.
Thanks.