Change a string recursively in files located in folders and subfolders
So, lets say I have a project that have generated lots of xml files. Though all these xml files point to a location with the text name TEXT15. I want to change all the files that containts TEXT15 and change it to TEXT16.
This actually works for files in a folder but not recursively in all the entire files.... perl -pi -c 's/TEXT15/TEXT16/g' ./* but I have many subfolders and within this more subsub folders....i just want to do this recursively. |
Try the following:
Code:
#!/bin/bash |
I am guessing you could probably just use the find itself:
Code:
find . -name *.xml -exec sed 's/TEXT15/TEXT16/g' {} \; |
All times are GMT -5. The time now is 07:49 AM. |