Hi!
Well, I solved this (nice exercise by the way!) using a small script (who_table.sh), that will get you this output:
Code:
./who_table.sh
cat who_table.html
<table>
<tr>
<td>hmw</td>
<td>:0</td>
<td>2016-04-16</td>
<td>08:37</td>
<td>(:0)</td>
</tr>
<tr>
<td>hmw</td>
<td>pts/0</td>
<td>2016-04-16</td>
<td>13:02</td>
<td>(:0.0)</td>
</tr>
<tr>
<td>hmw</td>
<td>pts/1</td>
<td>2016-04-16</td>
<td>13:02</td>
<td>(:0.0)</td>
</tr>
<tr>
<td>hmw</td>
<td>pts/2</td>
<td>2016-04-16</td>
<td>19:36</td>
<td>(:0.0)</td>
</tr>
<tr>
<td>hmw</td>
<td>pts/3</td>
<td>2016-04-16</td>
<td>19:43</td>
<td>(:0.0)</td>
</tr>
<tr>
<td>hmw</td>
<td>pts/4</td>
<td>2016-04-16</td>
<td>19:45</td>
<td>(:0.0)</td>
</tr>
<tr>
</table>
It renders like a regular table when i open it in Firefox. If you show me what you have done this far, maybe I can help you out.
I used a for loop in combination with who, grep, lots of echo (pardon the pun), and if/else.
Best regards,
HMW
Edit: Spotted a minor bug; my script leaves a trailing <tr> tag at the end, but I can't be arsed to fix it right now, and - like I said - it renders just fine in Firefox despite it!