i am in the middle of creating the script to match the string and replace it
in mount.txt
mickey:/work1 /work1 bla bla bla
mickey:/work2 /work2 bla bla bla
micket:/job /job bla bla bla
Expand|Select|Wrap|Line Numbers
- #!/usr/bin/python
- import string
- s = open("/usr2/py/mount.txt","r+")
- for line in s.readlines():
- print line
- string.replace(line, 'mickey','minnie')
- print line
- s.close()
I am using CentOS 4.6 and the python is 2.3.4