Skip to content

Instantly share code, notes, and snippets.

@kd7lxl
Created October 9, 2010 20:37
Show Gist options
  • Save kd7lxl/618579 to your computer and use it in GitHub Desktop.
Save kd7lxl/618579 to your computer and use it in GitHub Desktop.
# in case of chmod -x /bin/chmod
from sys import argv
from os import chmod, stat
from stat import S_IEXEC
def chmodx(filename):
chmod(filename, stat(filename).st_mode | S_IEXEC)
if __name__ == "__main__":
for filename in argv[1:]:
chmodx(filename)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment