Skip to content

Instantly share code, notes, and snippets.

Created Apr 3, 2015
What would you like to do?
#!/usr/bin/env ruby
if ARGV.size != 3
puts "usage: ack-sed <pattern> <replace-string> <dir>"
query, replace, dir = ARGV
system("ack #{query} #{dir} | cut -d':' -f1 | uniq | LANG=C xargs sed -i -e 's/#{query}/#{replace}/g'")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment