I've something like:
var1=name
var2=surname
I need export these variables and import it to html file
any idea?
echo "<html><body>" > index.html
echo "var1 is $var1 <br>" >> index.html
echo "var2 is $var2 <br>" >> index.html
echo "</body></html>" >> index.html
对于一个简单的模板形式,你可以做
var1=name
var2=surname
cat > somefile.html << EOF
<title>$var1's demo page!</title>
<body>
Hello, $var1 $var2.
</body>
EOF