Hi Rich,
I made the new subroutine to return dummy temperature values (and re-named and commented out the original one). In the new subroutine, I don't need to declare "cpu_temp" and "board_temp" as double variables since that's done right in the subroutine definition line ?, right at the start ?, just wanted to make sure, that's definitely different than Fortran !, would find out in any case when compiling I suppose !
I'm trying to get the offset and error out of the chrony log file located in /home/tc/chrony/log/statistics.log, I thought I would try it this way first since this is how Peter does it (with ntp log files though).
If I execute "tail -2 /home/tc/chrony/log/statistics.log" we'll get what's shown in out.txt file attached here. I want the numbers in the second and third columns (of numbers), that's the offset and the error (std. deviation) respectively (I think I would want just the second row though, which is for the PPS source).
Executing "tail -1 /home/tc/chrony/log/statistics.log | cut -d ' ' -f 1" gives me the date, like "2021-07-11", so I think that's good.
And then executing "tail -1 /home/tc/chrony/log/statistics.log | cut -d ' ' -f 2" gives me the time, like "20:37:56", so I think that's good as well.
But, executing "tail -1 /home/tc/chrony/log/statistics.log | cut -d ' ' -f 18" works for the second column and executing "tail -1 /home/tc/chrony/log/statistics.log | cut -d ' ' -f 20" works for the third column, but only when all the numbers are positive, a negative sign in there will mess things up since I'm using the ' ' (a space) as the delimiter.
Is there a good way to get around that with a better use of the "cut" command ?
Otherwise, I would need to get the offset and error from the output of "chronyc sources" (like you suggested) but I think even there I would have the same issue when running something like, "chronyc sources grep PPS | cut -d ' ' -f 41" (for the offset) and then "chronyc sources grep PPS | cut -d ' ' -f 46" (for the error), but again, this isn't foolproof since the output of "chronyc sources" isn't always "fixed format".
Thanks,
David