SOLVED
You need a \ at the end of each line like this.
Code:
sedString='\
Many\
lines\
of \
code \
that \
go \
for\
a \
long\
time\
'
sed -i 's|that| a\'"$sedString"' |' /home/jack/myfile
-------------------------------------------------------------------
Say I have the following in my shell script:
Code:
sedString='
Many
lines
of
code
that
go
for
a
long
time
'
sed -i 's|that| a\'"$sedString"' |' /home/jack/myfile
When I run this I get an error:
sed: -e expression #1, char 36: unterminated `s' command
How do I fix this?