0

I would like to save certain information from acpitool and also the load of all my CPUs as a function of time. More specifically acpitool -B gives me the following output:

Battery #1     : present
  Remaining capacity : 72250 mWh, 77.27%, 03:47:52
  Design capacity    : 93600 mWh
  Last full capacity : 93500 mWh, 99.89% of design capacity
  Capacity loss      : 0.1068%
  Present rate       : 19024 mW
  Charging state     : Discharging
  Battery type       : Li-ion 
  Model number       : 45N1011
  Serial number      : 36403

I would like to have an ascii file where I save the remaining capacity (all three quantities, i.e. the remaining capacity, percentage and time), the present rate and the load of my eight CPUs and the average load as a function of time, e.g.

t remaining_capacity remaining_percentage remaining_time CPU_1 CPU_2 ...

Can I do that just with bash and if yes how? If not what is a good way to do that?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • Yes you can! Provide an example output for this sample input and some of your attempts – fedorqui Oct 27 '15 at 14:02
  • I am not sure. I know that I can store the output of a command with something like var1=$(command) but acpitool -B gives me several lines of output. Furthermore I would have guessed that you would probably need to use awk to finally get specific parts of the output and saves them each in their own variable which you then could output in a table. When it comes to CPU load I have no idea. – Alice in space Oct 27 '15 at 16:31

0 Answers0