Networker

Re: [Networker] Help with Directive Format / Wildcard Syntax Please

2005-12-29 17:38:25
Subject: Re: [Networker] Help with Directive Format / Wildcard Syntax Please
From: Tim Mooney <mooney AT DOGBERT.CC.NDSU.NODAK DOT EDU>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Thu, 29 Dec 2005 16:30:29 -0600
In regard to: [Networker] Help with Directive Format / Wildcard Syntax...:

Starting from root, skip all files that end in ".dbf", but don't apply the
skip to those .dbf files that start with "arch".

As an example in the list of files below, I want to skip "file1.dbf" and
"file2.dbf", but not skip "arch1.dbf" and "arch2.dbf".

file1.dbf
file2.dbf
arch1.dbf
arch2.dbf

We thought about tackling this by applying the skip first, and then adding
in a forget so that the skip didn't apply to files starting with
"arch*.dbf", but the forget only seems to apply to directories.

<< / >>
       +skip: *.dbf

<< /arch*.dbf >>
       forget";

The above does not work.

It's a good first try, and it proves you've read the man page.  ;-)

Is there a wildcard format for the skip command that would do the equivalent
of the following ls command in unix?

ls !(arch*).dbf

That's more of an extended glob/fnmatch that your shell (which appears to
be csh/tcsh ? ) is giving you.  NSR directives use only the basic glob
characters, AFAIK.

There's no easy way that I know of with a basic glob() to invert a class
of characters, so this won't work:

        << / >>
                +skip: [^a][^r][^c][^h]*.dbf

(read that as: anything other than "a", followed by anything other than
"r", followed by ...).

Assuming that your .dbf file names are limited to a predictable range of
characters, you *might* be able to get most of the way there by doing
something like:

        << / >>
                +skip: [0-9A-Zb-z]*.dbf

This will skip files named 001.dbf, foo.dbf, FOO.dbf, etc.  It will not
skip any .dbf file that has a filename that begins with the letter a.  It
also will not skip any .dbf files that have names that begin with
characters outside these classes, so things like

        ?005.dbf
        -foo1.dbf
        überdb.dbf

etc, will not be skipped.

It's not a perfect solution, especially if you have a lot of .dbf files
that begin with the letter a, but it gets you most of the way there.

Tim
--
Tim Mooney                              mooney AT dogbert.cc.ndsu.NoDak DOT edu
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164

To sign off this list, send email to listserv AT listserv.temple DOT edu and type 
"signoff networker" in the
body of the email. Please write to networker-request AT listserv.temple DOT edu 
if you have any problems
wit this list. You can access the archives at 
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER
<Prev in Thread] Current Thread [Next in Thread>