Advertisement
Guest User

Untitled

a guest
Jul 14th, 2012
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. #!/bin/python
  2.  
  3. import os, sys
  4.  
  5.  
  6. old = "www.example.com"
  7. new = "subdomain.example.com"
  8.  
  9. recursive = os.popen("find ./ -name '*.php'").read().split("\n")
  10.  
  11. for n in recursive:
  12.     name = n.strip()
  13.     if len(name) == 0:
  14.         continue
  15.    
  16.     handle = file(f, "rw")
  17.     f.write(f.read().replace(old, new))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement