On Fri, Feb 09, 2001 at 03:43:16PM -0600, K Old <[EMAIL PROTECTED]> wrote:
| I'm trying to write a script that will recurse through a directory structure 
| and write all files not specified in a "control" file into a second file.  
| So, to break it down.  I would give you file with a list of filepaths each 
| one on a new line (i.e. /docroot/bvdev1/index.html).  I would then run the 
| script starting in a certain directory (i.e. /docroot/bvdev1/).  It would 
| then write out all files not listed in the first file to a second file.  
| Because /docroot/bvdev1/index.html was in the first file, it would not be 
| written into the second file.  /docroot/bvdev1/webmaster.html would be 
| written to the second file.

Well, bypassing perl (why reinvent the wheel?) I'd do this:

    find /the/dir -type f -print | sort | comm -23 - /the/list/to/exclude

Where /the/dir is the directory you're recursing through and
/the/list/to/exclude is the file containing the filename you don't
want. It must be sorted (comm needs both inputs to be sorted).

Simple and effective.
--
Cameron Simpson, DoD#743        [EMAIL PROTECTED]    http://www.zip.com.au/~cs/

My father was a despatch rider during the last war. He rode BSAs but, for
reasons I still don't understand, he never bothered to tell me that they
were useless, unreliable piles of shit. - Grant Roff, _Two Wheels_ Nov96



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to