I wanted to find every instances of a file under different directories and search for value 0 in each of those files and replace them with 500.
Please find the code below:
!/usr/bin/python
import glob
import os
a = glob.glob('/home/*/hostresolve')
for i in a:
print i
=================================
Now that I found all instances of hostresolve file under home. I wanted to search for value 0 and replace them with value 500 in each of these files. I know there is find and replace function in python but I wanted to know how can we use it to output that we got through glob.