Hello Rich,
Assuming that is in a bash script, you can do something like this:
echo $(date +%FT%T%:z) ${NEWIP} >> "/home/rshepard/getiplog"
See the man page for date for various formatting strings.
Regards,
- Robert
On Thu, Sep 25, 2014 at 9:39 AM, Rich Shepard <[email protected]> wrote:
> Cron runs a shell script to see if Frontier has changed my IP address. If
> the address has changed the new one is appended to a log file:
>
> echo $NEWIP >> "/home/rshepard/getiplog"
>
> How do I add a timestamp to that file along with the new IP address? Can I
> do something like 'echo $timestamp $NEWIP ...'?
>
> Rich
> _______________________________________________
> PLUG mailing list
> [email protected]
> http://lists.pdxlinux.org/mailman/listinfo/plug
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug