Created
August 19, 2012 22:04
-
-
Save tjluoma/3398050 to your computer and use it in GitHub Desktop.
This will limit the output of 'system_profiler' to the information AFTER 'Battery Information' and BEFORE 'System Power Settings'
This file contains 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
/usr/sbin/system_profiler |\ | |
sed '1,/Battery Information/d ; /System Power Settings/,$d' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For those of you who may not be familiar with sed, this says "Delete from the first line (1,) up to (and including) the line which includes 'Battery Information', and then delete from the line which includes 'System Power settings' to the end of the file or input ('$d' stands in for 'End Of Input')."
Yes, I'm sure you could probably do this in perl or python or ruby too, but sed works just fine.