for i in $tables if [ $i <> " " ]; then do do stuff done fi it gives me syntax error near unexpected token `if' line 54: ` if [ $i <> " " ]; then'