Last active
August 29, 2018 06:56
-
-
Save gorvin/6af9e323b4f3655c881d43bf4bcf6430 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
### Insert a file before or after the pattern by sed | |
sed -e '/PATTERN/r file1' -e //N file2 # Before pattern | |
sed -e '/PATTERN/r file1' file2 # After pattern |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment