right tool for the job

John Abreau jabr at abreau.net
Thu Mar 4 10:38:54 EST 2004


On Thu, 2004-03-04 at 09:59, Rob Lembree wrote:

> I need to make a list of files based on a few things.
> The list needs to explicitly exclude some directories,
> but with exceptions.  
> 
> So for example, I want to grab a whole directory hierarchy
> such as 'files', but exclude subdirectory 'exclude', but
> include subdirectory 'exclude/include'
> 
> 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.

It shouldn't be any more cumbersome in the shell than usual. Basically 
the file hierarchy you describe above can be separated into two or more 
hierarchies that you can concatenate: 

    * Everything under "files", excluding "files/exclude"
    plus
    * Everything under "files/exclude/include"

-- 
John Abreau / jabr at abreau.net / http://www.abreau.net 
(PGP) D5C7B5D9 / (FP) 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20040304/40ea6343/attachment.bin


More information about the gnhlug-discuss mailing list