python vs awk for simple sysamin tasks

Steve Lamb grey at
Thu Jun 3 16:47:27 CEST 2004

On 2004-06-03, Roy Smith <roy at> wrote:
> Neither of these are really tasks well suited to python at all.

    Individually, no.  Combined, yes.

> I'm sure you could replicate this functionality in python using things 
> like os.walk() and os.stat(), but why bother?  The result would be no 
> better than the quick on-liners you've got above. 

    Not true.  The above one liners are two passes over the same data.  With
an appropriate script you could make one pass and get both results.  Sure you
could do that in shell but I'm of the opinion that anything other than one
liners should never be done in shell.

         Steve C. Lamb         | I'm your priest, I'm your shrink, I'm your
       PGP Key: 8B6E99C5       | main connection to the switchboard of souls.

More information about the Python-list mailing list