1

Problems with if statement

view story
linux-howto

http://www.unix.com – Hi guys..i'm totally new to linux shell scripting and i have written a simple script that allows to poll a directory and when there is at least one file, it is moved to another directory. But i have an error in the if statement " Syntax error: "then" unexpected (expecting "done")" Code: #!/bin/bash while true do count=$(find /home/dirA -type f | wc -l) if[$count -gt 0];then         echo 'moving files'         mv /home/dirA/* /home/dirB/ else       echo 'no files found' fi sleep 60 done (HowTos)