The `if` part that `if [expression]; then` should be `if [ expression ]; then`. There must be space after [ and before ]see the [link](http://stackoverflow.com/questions/9581064/why-should-there-be-a-space-after-and-before-in-bash) And it will be better if there is an example given.