Created
February 24, 2017 18:51
-
-
Save topher6345/a72c7bc3bc5dbe0fea535b4ae109de90 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
unless ARGV[0] && ARGV[1] | |
puts <<-USAGE | |
Recursive global search and replace string | |
usage #{__FILE__} search replace | |
USAGE | |
exit(1) | |
end | |
exec "rg -l #{ARGV[0]} | xargs sed -i '' -e 's/#{ARGV[0]}/#{ARGV[1]}/g'"a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment