Simple stats function for the UNIX pipeline