+++ /dev/null
-#! /usr/bin/env python
-
-import sys
-
-if len(sys.argv) < 4:
- sys.stderr.write("Usage: %s [-i] from_re to_re file....\n" % sys.argv[0])
- sys.exit(1)
-
-import re
-if sys.argv[1] == '-i':
- search = re.compile(sys.argv[2], re.IGNORECASE)
- replace = sys.argv[3]
- start = 4
-else:
- search = re.compile(sys.argv[1])
- replace = sys.argv[2]
- start = 3
-
-from fileinput import FileInput
-files = FileInput(sys.argv[start:], inplace=1)
-
-for line in files:
- line = search.sub(replace, line)
- sys.stdout.write(line)
-
-files.close()