I have tried this countless ways, time to throw in the towel and ask the master...
#!/bin/bash
# Read in the VERSION.header file, this is a plain text file
# with returns, which in some of my tests, I am loosing the returns and getting
# one string wrapped only by the shell width
VERSION_HEADER=`cat VERSION.header`
sed 's/_VERSION_HEADER_/"$VERSION_HEADER"/g' DOCUMENTATION
The string '_VERSION_HEADER_' exists currently as line 1 in the file DOCUMENTATION. The file 'VERSION.header' has about 18 lines in it.
I am not attached to using sed. All I am looking to do is read in a file which acts as a template, store that files data as a variable, read in a second file, store it as a variable. Look in the second file for a marker, replace the marker with the data from the first file.
Example:
$cat VERSION.header
hi, this is my header file, how are you today
good, that is nice, great
have a nice day, k, thx, bye.
$cat DOCUMENTATION
_VERSION_HEADER_
# This is a documentation file, please read it
# If you do not read it, you will get stuck to the toilet.
And the result should be:
hi, this is my header file, how are you today
good, that is nice, great
have a nice day, k, thx, bye.
# This is a documentation file, please read it
# If you do not read it, you will get stuck to the toilet.