1#!/bin/bash 2for file in $(find . -type f); do 3 if [ "$(head -c 2 $file)" == "#!" ]; then 4 chmod u+x $file 5 else 6 chmod a-x $file 7 fi 8done 9