-1

I've something like:

var1=name
var2=surname

I need export these variables and import it to html file

any idea?

4

2 回答 2

3
echo "<html><body>" > index.html
echo "var1 is $var1 <br>" >> index.html
echo "var2 is $var2 <br>" >> index.html
echo "</body></html>" >> index.html
于 2013-06-27T18:56:47.283 回答
0

对于一个简单的模板形式,你可以做

var1=name
var2=surname

cat > somefile.html << EOF
  <title>$var1's demo page!</title>
  <body>
    Hello, $var1 $var2. 
  </body>
EOF
于 2013-06-28T01:58:36.663 回答