root@python-10:/home/liujianzuo/python/test# ls
passwd rc.local test1
root@python-10:/home/liujianzuo/python/test# py test1 -r EXIT exit /home/liujianzuo/python/test/rc.local
共修改了0行。
root@python-10:/home/liujianzuo/python/test# py test1 -r exit EXIT /home/liujianzuo/python/test/rc.local
the new line is :
第 6 行 : # Make sure that the script will "EXIT 0" on success or any other
the word was replaced is : exit==>EXIT
the new line is :
第 16 行 : EXIT 0
the word was replaced is : exit==>EXIT
共修改了2行。
root@python-10:/home/liujianzuo/python/test# cat test1
#coding:utf-8
#!/usr/bin/env python
import sys,os,subprocess
#a="liujianzuo"
if len(sys.argv) < 5:
exit("argc less than 4;like python test.py -r 准备替换的字符 要替换的字符 file_path_name")