Amanda-Users

[Fwd: Re: Regular Expressions and disklist]

2002-12-28 16:40:33
Subject: [Fwd: Re: Regular Expressions and disklist]
From: Galen Johnson <gjohnson AT trantor DOT org>
To: amanda-users AT amanda DOT org
Date: Sat, 28 Dec 2002 16:02:36 -0500

--- Begin Message ---
Subject: Re: Regular Expressions and disklist
From: Jon LaBadie <jon AT jgcomp DOT com>
To: Galen Johnson <gjohnson AT trantor DOT org>
Date: Fri, 27 Dec 2002 00:51:44 -0500
On Thu, Dec 26, 2002 at 09:48:32PM -0500, Galen Johnson wrote:
> Craig Hancock chancock AT bsd.uchicago DOT edu wrote:
> 
> >I want to know if it is possible in a disk list to specify
> >multiple directories on one line using regular expressions 
> >like so
> >
> >./NL-SFS3-02[4-7]
> >
> fairly certain GNU tar understands regular expressions...I think amanda 
> will pass the args as is so hopefully it should work...would anything be 
> hurt by trying it? If it doesn't work, at worst, you'll back them all 
> up...at best the backup will fail (or would that be worst).
> 

A note of caution on terminology.

There are two commonly encountered pattern matching semantics in unix,
"file name generation" (FNG, aka shell wildcards) and "regular expressions"
(RE, in multiple forms as in basic and extended).

I'm fairly certain that gnutar uses FNG patterns, not RE's.

The GNU documentors compound the problem by using both terms in the same
section of the "info" page.

   Use the `--exclude-from=FILE-OF-PATTERNS' option to read a list of
   shell wildcards, one per line, from FILE; `tar' will ignore files
   ^^^^^^^^^^^^^^^
   matching those regular expressions.  Thus if `tar' is called as
                  ^^^^^^^^^^^^^^^^^^^
   `tar -c -X foo .' and the file `foo' contains a single line `*.o', no
   files whose names end in `.o' will be added to the archive.

However, note that their description for the example "*.o" is only correct
for shell wildcards, not RE's.  If the gnutar was considering *.o as an RE,
the "." would mean any one character, not a literal dot.  Also, the asterix
would be ambiguous as in RE's it must be preceeded by, and is associated
with, a leading character.


Anyone disagree that gnutar uses FNG patterns, not RE's?

-- 
Jon H. LaBadie                  jon AT jgcomp DOT com
 JG Computing
 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)

--- End Message ---
<Prev in Thread] Current Thread [Next in Thread>
  • [Fwd: Re: Regular Expressions and disklist], Galen Johnson <=