File: replace.py

package info (click to toggle)
widelands 1%3A12-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 118,052 kB
  • ctags: 9,799
  • sloc: cpp: 71,051; python: 1,368; ada: 444; sh: 292; makefile: 282; objc: 274
file content (12 lines) | stat: -rwxr-xr-x 223 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/python -tt

import sys
import os

expr = sys.argv[1]
files = sys.argv[2:]

for file in files:
    os.system("cat '%s' | sed '%s' > /tmp/tmpfile" % ( file, expr ));
    os.system("mv /tmp/tmpfile '%s'" % file );