rdegges / energy-tracker

A simple script (meant to be run via cron) that tracks your Mac laptop's energy usage in watt hours.
The Unlicense
33 stars 1 forks source link

log to a csv file, fix the command for sonoma #3

Open raoulg opened 6 months ago

raoulg commented 6 months ago

The current command did not store the output. I used tail -n 1 to get the number from lldb, and awk to remove the (int).

Additionally, I check if the file exists, if not, I create a first line with the column names. This way it is easier to read the file with the most common libraries