Skip to content

Instantly share code, notes, and snippets.

@simonswine
Created February 17, 2020 11:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonswine/e107826f95d44d10bb2af411a55ada46 to your computer and use it in GitHub Desktop.
Save simonswine/e107826f95d44d10bb2af411a55ada46 to your computer and use it in GitHub Desktop.
#!/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