Skip to content

Instantly share code, notes, and snippets.

@jrun
Created July 1, 2010 01:09
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 jrun/459417 to your computer and use it in GitHub Desktop.
Save jrun/459417 to your computer and use it in GitHub Desktop.
This sucks. What is the better way?
#!/usr/bin/env ruby
find = ARGV[0]
replace = ARGV[1]
`ack '#{find}' -l`.split.each do |f|
`sed -i 's/#{find}/#{replace}/g' #{f}`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment