I am trying to replace the customernumber in my text file with the input assigned to the variable named input. But unable to complete this using sed, Below is the method am trying
input=$(cat customernumber.txt)
echo $input
cat CUSTOMER_REPORT.txt | sed -e s/%customernumbers%/$input/g > temp.sql
My customernumber.txt
contains the values (12345,67890)
, my CUSTOMER_REPORT.txt
contains the below values:
SELECT CUSTOMERNUMBER,ORDERNUMBER
FROM ORDER WHERE CUSTOMERNUMBER IN %customernumbers% WITH UR;
I am getting the below error:
sed: -e expression #1, char 31: unterminated `s' command
How to replace the %customernumbers% with the value in $input? Is there any other option available other than sed?