Created
February 15, 2017 15:43
-
-
Save aliceinwire/7545b1e3cca86340e89a9ddced724840 to your computer and use it in GitHub Desktop.
emerge-time.sh
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
# listing emerge compiling time | |
function emergetime { | |
genlop -nt '*' | | |
tail -n +3 | | |
sed -n ' | |
1~3 {x;b} | |
3~3 d | |
# prefix 0 | |
s/ \([0-9] \)/ 0\1/g | |
# remove "," and "and" | |
s/\(,\|and \)//g | |
# remove tailing dot | |
/merge time/ s/\.$// | |
# remove plural | |
s/\(hour\|minute\|second\)s/\1/g | |
s/\([0-9]\+\) second/A \1/ | |
s/\([0-9]\+\) minute/B \1/ | |
s/\([0-9]\+\) hour/C \1/ | |
G | |
s/\n// | |
# remove extra heading spaces | |
s/^ \+// | |
p | |
' | |
} | |
# Sort compiled time package showing the 30 most time expensive package | |
emergetime | sort | tac | head -30 | nl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment