lvjian700
7/3/2013 - 3:41 AM

bulk search and replace with the silver searcher, awk, sed and xargs

bulk search and replace with the silver searcher, awk, sed and xargs

ag "sometext" --nogroup | awk '{print substr($1,1,index($1,":")-1);}' | xargs -I {} sed -i .bak -e 's/sometext/anothertext/g' {}