So, I have been working on my own on something for a week now and am getting nowhere. I am taking a very advance CIS class that I have done well in so far but towards the end I am working with stuff that I haven't learned yet. I should have waited a couple of semesters to talk this class because I am unprepared for what I am doing now. My main problem is not knowing HTML (I haven't ever had a reason to learn it).
Any ways I have a nawk script template that I have figured out that I need to use. It is derived from a color generator script and is the following:
#!/bin/nawk -f
#-----------------------------------------------------------------------------
#YOUR COMMENTS HERE
#-----------------------------------------------------------------------------
BEGIN {
print "<html>"
print "<body>"
print " <table border=2>"
print " <tr>"
print " <th>$first $last</th>" ###Change this
print " <th>$username</th>" ###Change this
print " <th>Color</th>" ###Change this
print " </tr>"
}
{
print " <tr>"
print " <td>" $1 "</td>" ###Change this
print " <td>" $2 "</td>" ###Change this
print " <td>" $3 "</td>" ###Change this
print " </tr>"
}
END {
print "</table>"
print "</body>"
print "</html>"
}
As you can see on the 12th and 13th line I have added $first $last, and $username respectively. Am I doing this right. Because I don't know HTML, every time I look at it, it is confusing the !@#$ out of me.
The following is supposed to be the output:
<html>
<body>
<table border=2>
<tr><th>Name</th><th>Username</th><th>Email</th></tr>
<tr>
<td>Michael Raby</td>
<td>mraby</td>
<td><a href="mailto:mike1071@yahoo.com">mike1071@yahoo.com</a></td>
</tr>
<tr>
<td>Hajar Alaoui</td>
<td>halaoui</td>
<td><a href="mailto:hajar6@hotmail.com">hajar6@hotmail.com</a></td>
</tr>
<tr>
<td>Anne Lemar</td>
<td>alemar</td>
<td><a href="mailto:anne.lemar@asu.edu">anne.lemar@asu.edu</a></td>
</tr>
<tr>
<td>Russell Crotts</td>
<td>rcrotts</td>
<td><a href="mailto:Russell.Crotts@asu.edu">Russell.Crotts@asu.edu</a></td>
</tr>
<tr>
<td>Dan Mazzola</td>
<td>dmazzola</td>
<td><a href="mailto:dan.mazzola@sun.com">dan.mazzola@sun.com</a></td>
</tr>
<tr>
<td>Bill Boyton</td>
<td>bboyton</td>
<td><a href="mailto:boytonb@earthlink.net">boytonb@earthlink.net</a></td>
</tr>
</table>
</body>
</html>
The following is a sample of what the HTML table is supposed to look like:
Raby Michael mike1071@yahoo.com
Alaoui Hajar hajar6@hotmail.com
Lemar Anne anne.lemar@asu.edu
Crotts Russell Russell.Crotts@asu.edu
Mazzola Dan dan.mazzola@sun.com
Boyton Bill boytonb@earthlink.net
Can someone PLEASE help me? I've been trying to figure out this on my own for a week now.