With support for pipes, regexes, and efficiently using memory for large files
Replace domain.com with newdomain.com in a dump.sql file
resilient_replace -i 'domain.com' 'newdomain.com' dump.sql
Using --regex
your can replace test0.domain.com or test11.domain.com without changing testing.domain.com
resilient_replace -i --regex 'test[0-9]*.domain\.com' 'newdomain.com' dump.sql
cat dump.sql | resilient_replace 'domain.com' 'newdomain.com'
resilient_replace <search_pattern> <replace> [<file>]
-i, --in-place
edit file in place
--regex
treat <search_pattern> as a regex
--only-into-serialized
replace only into serialized data (do not replace into raw data)
If you already have a ~/bin
directory in your $PATH
, you can just paste this in a terminal:
mkdir -p ~/bin && \
git clone https://github.com/pa-de-solminihac/resilient_replace.git ~/bin/resilient_replace_git && \
ln -s ~/bin/resilient_replace_git/resilient_replace ~/bin/resilient_replace
cd ~/bin/resilient_replace_git && git pull