When you post code, please do so using [code] tags. This inproves readability to preserving whitespace and using a fixed width font.
You can iterate over files like this:
Code:
for thisfile in *; do
if test -f "$thisfile" -a -x "$thisfile"; then
echo "executable file: $thisfile"
else
echo "not executable or not file: $thisfile"
fi
done
You can modify the pattern * to examine only some sub-set of files in the directory, e.g.
Code:
for thisfile in *.txt; do
...
...to examine only files with a name ending in ".txt".