Heck I just can't remember ... I recently had a cool way to use ag
with sed
to do find and replace. The gist was simple, something like:
ag foo -l | ... magic here ... sed 's/foo/bar/g'
That doesn't work, but you might just know what does. Thanks!
PS. Three cheers for the Silver Searcher.
xargs is the magic you are looking for:
ag -l 'foo'|xargs sed -i 's/foo/abcd/g'