I have this bash:
replace="s/AAAA/BBBB/g";
find myDirectory/. -type f -print0 | xargs -0 sed -i $replace;
that will recursively scan myDirectory
tree and replace all occurrences of AAAA
with BBBB
on the files there.
But I want to limit this to happen on files of specific extensions, for example, .txt
, .read
, .po
How do I impose this limit?