Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python2
- try:
- import os,shutil
- except ImportError:
- print "[!] One or more library is missing...\n\n"
- exit(-1)
- current_dir = '.'
- for subdirs, dirs, files in os.walk(current_dir):
- for item in files:
- old_value = ''
- new_value = ''
- shutil.copyfile(os.path.join(subdirs,item),os.path.join(subdirs,item)+'.backup')
- fp = open(item,'r')
- file_contents = fp.read()
- new_file_contents = file_contents.replace(old_value, new_value)
- fp.write(new_file_contents)
- fp.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement