I'm very new to SH and development and I'm blundering my way through the code one error at a time.
I've come across this error now that I can not get to the bottom of. Any help would be great!
I am running a sh script in GitHub Actions and am receiving this error:
sed: -e expression #1, char 73: unterminated `s' command
Here's my code:
SPECTESTSFILE='manifest/specifictests.xml'
cat $SPECTESTSFILE
BUILDXML_TEMPLATE_FILE='buildFiles/buildrunspecifictests.template.xml'
SPECTESTS="$(cat $SPECTESTSFILE)"
echo "Specified Tests: "
echo $SPECTESTS
sed -i "s|<runTest></runTest>|$SPECTESTS|g" $BUILDXML_TEMPLATE_FILE
In my manifest/specifictests.xml file, I have a list of RunTests with new lines
<runTest>...</runTest>
<runTest>....</runTest>
and I want to insert this list into the buildFiles/buildrunspecifictests.template.xml file
<deploy>
<runTest></runTest>
</deploy>
Eventually, I want the file to look like this:
<deploy>
<runTest>...</runTest>
<runTest>....</runTest>
</deploy>
What I've found is that if there are no newlines in the manifest/specifictests.xml file then it works but this doesn't allow me much freedom for the user's using it or eventually automating the creation of this file elsewhere.
Does anyone know a fix?