Finding files with wc -l results = 1 then moving the files to another folder

Hi guys can you please help me with a script to find files with one row/1 line of content then move the file to another directory my script below runs but nothing happens to the files....Alternatively Ca I get a script to find the *.csv files with "wc -1" results = 1 then create a list of those filenames then move the files in the list to a different folder

from=/optima/prd/optdir/testbsc/dist/to=/optima/prd/optdir/testbsc/dist_old/for file in $from/*.do    if [ -f $file ] ; then      if [ $(cat $file | wc -l) -eq 1] ;          then           bname=$(basename $file)           mv $file $to/$bname      fi    fidone
from=/optima/prd/optdir/testbsc/dist/
to=/optima/prd/optdir/testbsc/dist_old/
for file in $from/*.csv
do
 if [ -f "$file" ]
 then
  lines_count=$(wc -l < "$file")
  if [ "$lines_count" -eq "1" ] 
  then
   bname=$(basename $file)
   mv $from/$file $to/$bname      
  fi
 fi
done

Thanks for the quick response but im getting the error below
mv: /optima/prd/optdir/testbsc/dist///optima/prd/optdir/testbsc/dist//JHB_100001_BSCPSBasicMeasurement_23Apr2012_0600-23Apr2012_0700.csv: cannot access: No such file or directory

try:

mv "$file" "$to"

( instead of mv $from/$file $to/$bname )

Just change

mv $file $to/$bname

thanks guys it works