Skip to content

Instantly share code, notes, and snippets.

@naganowl
Created August 7, 2018 01:42
Show Gist options
  • Save naganowl/bf7a685625916264fe30b23c40a82947 to your computer and use it in GitHub Desktop.
Save naganowl/bf7a685625916264fe30b23c40a82947 to your computer and use it in GitHub Desktop.
Double loop over files for better performance
# Assumes two files present (`sel` and `filez`)
# OSX needs an empty zero length argument, which is quite difficult to escape if using the same type of quotations
# Inner file (`filez`) is used over a `find ... -exec` to cut down on repetitive operations
cat sel | xargs -I '{}' sh -c 'cat filez | xargs sed -i "" "s/{}//"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment