right tool for the job

brian lists at karas.net
Thu Mar 4 10:14:11 EST 2004


On Thu, 2004-03-04 at 09:59, Rob Lembree wrote:
> files
> files/exclude         <---- this directory is excluded
> files/exclude/include <---- except this directory or file
> files/exclude/others...
> 
> The question everyone is Perl, Python, or something else?
> Simple shell scripting for this kind of thing is cumbersome.

No experience with Python...

I imagine with perl, you could read in the full directory path, split()
on the /'s and push the resulting individual path locations into an
array.  If the last value of the array is "exclude" then you exclude the
directory.  If the last value is "include" or !"exclude" (or whatever
works for you) then process the directory.

As with all things perl, I'm sure there are n^n+1 solutions for every n
persons looking at the problem...





More information about the gnhlug-discuss mailing list