fnmatch shell script

Hi, Does anyone have an examples of using fnmatch in a shell script? I am fairly new to shell script and have written the following but just get a syntax error on the fnmatch line... can someone please help?

#!/bin/bash

export P=0
export pendingDir=/export/home/shahzads/fakepending/

for filename in 'find $pendingDir -name "*.data" -print'
do (
if ['fnmatch("*data" $filename)']
then
echo "match found"
fi
)
done

Thanks in advance

SS

fnmatch only works inside a C or C++ program, after it is compiled. Unless you have an different setup.

shells provide pattern matching. Your script already does it without fnmatch.

echo "file count = `find $pendingDir -name \*.data -print | wc -l`"

Thanks Jim, I think I was over complicating things (as usual).