I use the following command to replace strings in texts:
grep -rl "abc" A.txt | xargs sed -i 's/abc/efg/g'.
But I also want to replace Abc
with efg
. The following command seems not working.
grep -irl "abc" A.txt | xargs sed -i 's/abc/efg/g'
using the -i
for grep is to find case-insensitive lines, but in the subsequent sed
command, it will won't admit Abc
.
So, my question is how to sed
to replace case-insensitive texts?