Multiple Substitutions across Multiple Files

view story

http://www.unix.com – Hey everyone! I am determining the best method to do what the subject of this thread says. I only have pieces to the puzzle right now. Namely this: grep -rl "expression" . | xargs open (I should mention that the intention is to grep through many files containing the "expression" and return the files themselves for subsequent editing.) and this: ... | for line in source; do sed 's/expression/replacement/g' > tmp; done Except that the issue is how to open each file, substitute, and save to the same respective files, not just save to one big tmp fi (HowTos)