is there anyway i can paste/cat a text file into a html paragraph <p>
function html_header
{
cat <<END
<html>
<head><title>${1}</title></head>
<body>
<p>
${2}
</p>
END
}
function html_footer
{
cat <<END
</body>
</html>
END
}
is there anyway i can paste/cat a text file into a html paragraph <p>
function html_header
{
cat <<END
<html>
<head><title>${1}</title></head>
<body>
<p>
${2}
</p>
END
}
function html_footer
{
cat <<END
</body>
</html>
END
}
replace
<p>
${2}
</p>
with
<p>
$(cat $2)
</p>
filename="whatever"
htmlfile=whatever.html
header='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title></title>
</head>
<body>
<p>
'
footer='
</p>
</body>
</html>'
{
printf "%s\n" "$header"
cat "$filename"
printf "%s\n" "$footer"
} > "$htmlfile"