Last active
May 10, 2020 13:08
-
-
Save metaskills/698a5139a79bbdaddcc84626f35de7ec to your computer and use it in GitHub Desktop.
Learning to Program The Cloud
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
insert_file_over_pattern () { | |
dline=$(sed -n "/${2}/=" $1) | |
rline=$(expr $dline - 1) | |
sed --in-place -e "${dline}d" $1 | |
sed --in-place "${rline}r ../inserts/${1}" $1 | |
} | |
insert_file_over_pattern 'config/application.rb' 'Bundler.require' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment