I have a bash script that runs every 5 minutes via cron:
#!/bin/bash
echo "`users | wc -w`" users logged on @" `date`" >> /var/www/users.html
I need the output text to display in a html page in a single column. I have been using the following HTML code but don't know how to get the output from the script to display properly between the tags dynamically. The script will run and add the output after the HTML code:
<table>
<tr>
<td>2 users logged on @ Fri Jan 16 16:59:01 EST 2015</td>
</tr>
<tr>
<td>2 users logged on @ Fri Jan 16 16:59:01 EST 2015</td>
</td>
<tr>
<td>2 users logged on @ Fri Jan 16 16:59:01 EST 2015</td>
</tr>
</table>
2 users logged on @ Fri Jan 16 19:11:02 EST 2015
2 users logged on @ Fri Jan 16 19:12:01 EST 2015
2 users logged on @ Fri Jan 16 19:13:01 EST 2015
2 users logged on @ Fri Jan 16 19:14:01 EST 2015
Any help is appreciated thank you.