diff options
author | Florian Pritz <bluewind@xinu.at> | 2013-05-11 13:03:54 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2013-05-11 13:03:54 +0200 |
commit | a9ba01279e6f3c64b082f4de6e7d95cd1b5f7dab (patch) | |
tree | 3262e1dbda911fc32e156de213af574f326b4794 /replace.py | |
parent | 66f84afc20c5bb627ec5979bd9b3e8b144c3419d (diff) | |
download | bin-a9ba01279e6f3c64b082f4de6e7d95cd1b5f7dab.tar.gz bin-a9ba01279e6f3c64b082f4de6e7d95cd1b5f7dab.tar.xz |
lots of new stuff and misc changes
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'replace.py')
-rwxr-xr-x | replace.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/replace.py b/replace.py new file mode 100755 index 0000000..efa8b54 --- /dev/null +++ b/replace.py @@ -0,0 +1,17 @@ +#!/usr/bin/python + +import sys + +string_from = sys.argv[1] +string_to = sys.argv[2] +files = sys.argv[3:] + +for filename in files: + f = open(filename, "r+") + data = f.read() + data = data.replace(string_from, string_to) + f.seek(0) + f.truncate() + f.write(data) + f.close() + |