Comment Re:I only write trivial shell scripts (Score 3, Interesting) 411
I agree python is lots of fun... but I do not call following script to be nontrivial.
> In Python, you can do things like
> junk_extension = (".temp", ".tmp", ".junk")
> if filename.endswith(junk_extension):
> os.remove(filename)
Your problem is: thinking ten lines of "if" statements to look at a filename.
This kind of things are done in 1 liner single shell command. This is too simple to bother python.
Please read about the "find" command. especially with --exec rm '{}' \;
Osamu