Last active
August 16, 2017 18:42
-
-
Save spenserpothier/913401954d46548d4993816adae969c5 to your computer and use it in GitHub Desktop.
Replace REPLACEME in fileB with the contents of fileA with " " prepended to each line, save to fileC
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
# Replace REPLACEME in fileB with the contents of fileA with " " prepended to each line, save to fileC | |
awk 'NR==FNR { a[n++]=" "$0; next } | |
/REPLACEME/ {for (i=0; i<n; ++i) print a[i]; next } | |
1' fileA fileB > fileC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment