Created
February 17, 2020 11:35
-
-
Save simonswine/e107826f95d44d10bb2af411a55ada46 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/awk -f | |
BEGIN { | |
D="cd /overlay/upper/usr/lib/opkg/info&&" | |
C=D"ls *.list" | |
S="sort -n" | |
while(C|getline>0) { | |
P=substr(F=$1,1,length($1)-5) | |
J=D"du -sk $(cat "F")" | |
s=0 | |
while(J|getline>0) { | |
s+=$1 | |
t+=$1 | |
} | |
close(J) | |
print s"\t"P|S | |
} | |
close(S) | |
print t"\t---TOTAL---" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment