Changing file permission recursively

I have a directory named DIR. The contents of the directory is something like:

a.sh
b.sh
cghsk.sh
assjsjkd
gdshddll
DFG/
...
...

Where only DFG/ is a folder.

I want to grant execute permission to all(a+x), for all the files directly under the DIR directory except the files that doesn't have a file name extension.

chmod -R +x /DIR

wont solve my problem.

for fname in $(find /DIR | grep -v '\.' )
do
    chmod +x $fname
done

Worked it out.

for fname in $(find /DIR -maxdepth 1 -name "*.sh")
do
chmod +x $fname
done

Did the trick.

You dont require a loop there, a simple find command can do the trick.

find /DIR -maxdepth 1 -name *.sh -exec chmod +x {} \;

Oh Thanks