> which would run on nearly any Unix-like system
Did you mean on nearly any Unix-like system which has the output of du in the same format as the one on your machine? I don't believe those can be treated as standard if you want any kind of portability.