bindiego
4/30/2015 - 8:00 AM

Search String in text files and replace them

Search String in text files and replace them

#/bin/sh -ex

egrep -lRZ "http://rubygems.org|https://rubygems.org" . \

    | xargs -0 -l sed -i -e 's/http:\/\/rubygems.org/http:\/\/ruby.taobao.org/g'
    
    
egrep -lRZ "http://rubygems.org|https://rubygems.org" . \

    | xargs -0 -l sed -i -e 's/https:\/\/rubygems.org/http:\/\/ruby.taobao.org/g'