From the tutorial here, I learned to find and replace text across multiple files from the Linux command line. For example,
find . -name "*.php" -print | xargs sed -i 's/foo/bar/g'
finds all instances of 'foo' in files that end with '.php' and replaces such instances with 'bar'.
Now suppose I have multiple, redundant occurrences of something like
assert something.makeAssertion that I want to replace with just
something.makeAssertion. Given that
something can vary, how do I adapt the script for this? I tried some things with
$ to capture
something as a variable (?) but haven't figured it out.