Hi ,
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
However, the string.replace seems not working, any advice??? Thank you!
I am using CentOS 4.6 and the python is 2.3.4
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
Code:
#!/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
Comment