Skip to content

Instantly share code, notes, and snippets.

@mattConn
Created July 21, 2017 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattConn/edebfd8c049e30dd18e6ddcfce54db9d to your computer and use it in GitHub Desktop.
Save mattConn/edebfd8c049e30dd18e6ddcfce54db9d to your computer and use it in GitHub Desktop.
Uses sed to insert a file's contents at a specific string (directive), then remove the string (leaves behind a space).
sed -i '/##INSERT HERE/r file_to_insert.txt' file_inserted_to.txt
# now remove directive
sed -i 's/##INSERT HERE//g' file_inserted_to.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment