Created
June 19, 2014 13:33
-
-
Save cades/7ec00eb20918e853912e to your computer and use it in GitHub Desktop.
在 OS X 上取得電池啪數的方法
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# method 1 | |
pmset -g batt | sed -n 2p | awk -F "[\t;%]" '{ print $2 }' | |
# method 2 | |
brew tap Goles/battery | |
brew install battery | |
battery | awk -F "[\\\[\\\]%]" '{ print $3 }' | |
# method 3 | |
wget --no-check-certificate https://raw.githubusercontent.com/richo/battery/master/bin/battery | |
chmod +x battery | |
./battery | awk -F "%" '{ print $1 }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment