Skip to content

Instantly share code, notes, and snippets.

@renier
Created August 16, 2019 02:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renier/322a65157ca31fcbcaf3788228c8c7f7 to your computer and use it in GitHub Desktop.
Save renier/322a65157ca31fcbcaf3788228c8c7f7 to your computer and use it in GitHub Desktop.
Execute commands on all found files even if they have spaces and quotes in their names
while read f; do
$(cmd) -- "${f}"
done < <(find . -name "*.ext" -print0 | xargs -0 -n1 grep -Hsl "foobar")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment