if statement not working as desired

Hello all,

I am trying to write a post-commit hook script using bash script. What I am trying to do here is:

Developers check in their files to a branch. I check the repository and based on the commit I email QA people.

QA verifies and moves the files to a prod branch and email is sent out to managers.

below is an example of sending email to a QA user.

dev_found=`/usr/bin/svnlook changed $REPOS -r $REV | grep "dev"`

echo '##'$dev_found'##' >> $ACTION_LOG

if[ "$dev_found" <> '' ] then
        for i in `ls $EMAILS`; do
                $SENDMAIL -t < $i
        done
fi

but the problem here is this condition is good for all cases even when dev_found is empty and the conditional check does not work for that.

I have also tried the following conditional checks.

1. if[ "$dev_found" != '' ] then
2. if[ -n "$dev_found" ] then
3. if[ "$dev_found" != "" ] then
4. if[ "$dev_found" <> "" ] then

nothing seem to work. i get email when I move the files from dev branch to other branches like qa or prod. can any one help me with this? Thanks.

KM

Hi.

This one (or #1) would be correct:

3. if[ "$dev_found" != "" ] then

But should look like this:

3. if [ "$dev_found" != "" ]; then