I’m using the Mac OSX Terminal and using find then exec a sed on the files. How do i get it to list out the files that have been changed?
This is what I’m using:
find . -name '*.js' -exec sed -i '' 's/_persistenceURL = "prod"/_persistenceURL = "qa"/g' {} +
and I like how this outputs a list of files that match… can i get this from the sed?
find . -name "*.js" -exec grep -lr "_persistenceURL = \"prod\"" {} \;
here’s a quick and dirty way of doing it by adding a second
-execaction to the find statment which echoes the filename before sed processes it:note: the
+at the end may interfere a bit, so if it’s not strictly necessary, i’d replace it with\;.