Skip to content

Instantly share code, notes, and snippets.

@seejohnrun
Created June 21, 2013 19:01
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 seejohnrun/5833514 to your computer and use it in GitHub Desktop.
Save seejohnrun/5833514 to your computer and use it in GitHub Desktop.
I can never remember the args to find & xargs And a lot of times, I want something a billion % simpler
#!/usr/bin/env ruby
raise 'usage: globber \'views/**/*.php\' \'echo {}\'' unless ARGV.length == 2
Dir.glob(ARGV[0]).each { |f| system(ARGV[1].gsub('{}', f)) }
@seejohnrun
Copy link
Author

$ globber 'app/models/**/*.rb' 'echo "my favorite file is {}"'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment