You are not logged in.
I'm tired, so bear with me here
I want to be able to get the 0/1 value from /proc/pmu/info for my laptop in order to detect whether or not I'm connected with AC power.
Normally, the file looks something like this:
PMU driver version : 2
PMU firmware version : 0c
AC Power : 1
Battery count : 1
I'm trying something like "cat /proc/pmu/info | grep "AC Power" | cut -d : -f 2" to obtain the boolean value, but there's whitespace in the result (as you can probably see why). What would be the best way of getting the value?
Last edited by Korey Kaczynski (2008-02-19 12:28:52)
Offline
awk '/Power/ {print $4}' /proc/pmu/info
Last edited by lucke (2008-02-19 11:59:41)
Offline
Thanks! Looks like I ought to start familiarizing myself with awk.
Offline