I have a record.txt it will update weekly, and it could be 2 lines or more ...
it just echo each line to the script
san jose,23.34%
tampa,2.15%
dallas,30.20%
seattle,44.29%
Unknown,16.72%
How do i write a shell script to give me a test.pl or bash file which contain
#!/home/perl
print "Content-type: text/html\n\n";
print "<HTML><HEAD><TITLE>Testing</TITLE>\n";
print <<EOM;
<!-- graph code begins here-->
<script type=\"text/javascript\" src=\"./wz_jsgraphics.js\"></script>
<script type=\"text/javascript\" src=\"./pie.js\">
<!-- Pie Graph script-By Balamurugan S Java, Apache, Perl, CSS, DHTML, graph, chart, bar, pie, line, Free Resource, Spiritual, OM, Travelouge, Enlightenment //-->
<!-- Script featured/ available at Dynamic Drive code: Dynamic Drive DHTML(dynamic html) & JavaScript code library //-->
</script>
<center><div id=\"pieCanvas\" style=\"overflow: auto; position:relative;height:350px;width:400px;\"></div>
<script type=\"text/javascript\">
var p = new pie();
p.add("san jose",23.34);
p.add("tampa",2.15);
p.add("dallas",30.20);
p.add("seatle",44.29);
p.add("Unknown",16.72);
p.render("pieCanvas", "Pie Graph")
</script></center>
<!-- graph code ends here-->
EOM
print " </BODY></HTML>\n";
Or something like this bash file?
#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "<html><head><title>test"
echo "</title></head><body>"
echo "<!-- graph code begins here-->
echo " <script type=\"text/javascript\" src=\"./wz_jsgraphics.js\"></script>
echo " <script type=\"text/javascript\" src=\"./pie.js\">
echo " <!-- Pie Graph script-By Balamurugan S Java, Apache, Perl, CSS, DHTML, graph, chart, bar, pie, line, Free Resource, Spiritual, OM, Travelouge, Enlightenment //-->
echo " <!-- Script featured/ available at Dynamic Drive code: Dynamic Drive DHTML(dynamic html) & JavaScript code library //-->
echo " </script>
echo " <center><div id=\"pieCanvas\" style=\"overflow: auto; position:relative;height:350px;width:400px;\"></div>
echo " <script type=\"text/javascript\">
echo " var p = new pie();
echo " p.add("san jose",23.34);
echo " p.add("tampa",2.15);
echo " p.add("dallas",30.20);
echo " p.add("seatle",44.29);
echo " p.add("Unknown",16.72);
echo " p.render("pieCanvas", "Pie Graph")
echo " </script></center>
echo "<!-- graph code ends here-->
echo "</body></html>"