Remove execution permission recursively

by Rudd-O published 2008/11/11 19:05:00 GMT+0, last modified 2013-06-26T03:16:01+00:00

#!/bin/sh

#Remove execution permission recursively
#by Manuel Amador (Rudd-O)
#under the GPL

#you need to configure /etc/sudoers for this to work at all
# put this in your /etc/sudoers:
#your_username ALL = NOPASSWD: /bin/chmod
#(obviously, without the hash mark at the beginning of the line, and replacing your_username with your actual user name)

quoted=$(echo -e "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | awk 'BEGIN { FS = "\n" } { printf "\"%s\" ", $1 }' | sed -e s#\"\"##)

eval "sudo /bin/chmod -R a-x+X $quoted"