Register now and start sharing your code snippets.
-->

Appending after a pattern from a file in sed

Shell Script (Bash) posted about 1 year ago by marko

Useful when you want to append the contents of a whole file into something you are sed’ing. Be careful if you use -i, it will replace the working file.

   1  sed -i "/attr_accessor :config/r ../patch_for_application.rb.tmpl" app/controllers/application.rb

Tagged sed, linux, bash