My current requirement is to replace xxyxx string with value of date
date1 variable holds a date
and the current script writes html tags to a file as follows
echo date1
nawk 'BEGIN{
FS=","
print "<HTML>""<HEAD>""<p>Hi All,<br><br>There are no cases closed on the xxyxx"
print "that meet the criteria for submission.</p>"
}
END{
print "<p>Regards,<br>Application Team</p></BODY></HTML>"
}
' /u001/Scripts/abc.txt > /u001/Scripts/abc.html
I have tried like this as follows,
gawk -i inplace 'NR==1{gsub(/xxyxx/,"$$date1")};1' /u001/Scripts/abc.html
I am getting search string replaced as $$date1 instead I want value of date1
and the following sed command is not working
sed -i 's/xyxx/'"$date1"'/' /u001/Scripts/abc.html