RegExpr in ---exclude

tim.conway at tim.conway at
Mon Jun 24 13:32:01 EST 2002

Sorry.  I didn't mean to imply that the "=" is anything special, just that 
it shrinks the possible shell globs to the list to matching items in the 
"--exclude=" subdirectory.  If that globs, you're using wierd 
filenames.... Not that that can't happen:
tconway at alta:/users/tconway/test
>find . -print
tconway at alta:/users/tconway/test
But the, that would be awfully inconvenient, wouldn't it.
tconway at alta:/users/tconway/test
>rm -rf *
rm: unrecognized option `--exclude='
Try `rm --help' for more information.
tconway at alta:/users/tconway/test
>rm -rf --exclude=
rm: unrecognized option `--exclude='
Try `rm --help' for more information.
tconway at alta:/users/tconway/test

Nonetheless, If you don't consider what will happen to your tape drive if 
someone uses it for a sandwich warmer, your first support call is sure to 
be on that topic.


Tim Conway
tim.conway at
303.682.4917 office, 3039210301 cell
Philips Semiconductor - Longmont TC
1880 Industrial Circle, Suite D
Longmont, CO 80501
Available via SameTime Connect within Philips, n9hmg on AIM
perl -e 'print pack(nnnnnnnnnnnn, 
".\n" '
"There are some who call me.... Tim?"

"Bernard A Badger" <bab at>
Sent by: rsync-admin at
06/24/2002 12:05 PM

        To:     <rsync at>
        cc:     (bcc: Tim Conway/LMT/SC/PHILIPS)
        Subject:        RE: RegExpr in ---exclude

Just a comment on shell glob usage---see below.
> -----Original Message-----
> From: rsync-admin at [mailto:rsync-admin at]On
> Behalf Of tim.conway at
> Sent: Monday, June 24, 2002 12:29 PM
> To: J.Strohschnitter
> Cc: rsync at
> Subject: Re: RegExpr in ---exclude
> User Commands                                            rsync(1)
> Change
> rsync --exclude "/path/to/*/[Ff][Oo][Ll][Dd][Ee][Rr]"
> to
> rsync --exclude=/path/to/*/[Ff][Oo][Ll][Dd][Ee][Rr]
> and try again.  Frankly, I'm surprised you didn't get a usage message 
> that one.
> Note that I removed the quotes.  They are not necessary, since you won't
> get any shell globbing of your pattern, because of the pattern being
> connected to "--exclude" by "=".  The quotes won't break anything, so 
> can leave them in.

Well, sort of.  The "=" isn't special, is just because it's all one 

Shell globbing is done before the program is invoked, so
the shell globs on "--exclude=/path/to/*/[Ff][Oo][Ll][Dd][Ee][Rr]", but
unless you have a directory "--exclude=", it won't find anything.
It _does_ look for it, though, so it might be kinda slow in a populous

It's not strictly necessary, but I don't like to advise other people to do
something that "mostly" works, without making the risks clear.  If you 
know that
no such directory exists, use it.  Just don't forget that you're using a
Isn't there some option in some shell that causes commands to fail if a 
doesn't generate a result?

If you didn't remember to enter the quotes, you could go ahead because you
know what you're doing.  Command syntax with globs are inherently risky, 
of files named "-?" like "-r", "-f" and "-q".  That's why the "--" option 
invented, to keep the glob away from the options.

Be extra careful when you are writing shell scripts.  They'll be invoked 
ways you never imagined, so write defensively.

To unsubscribe or change options:
Before posting, read:

More information about the rsync mailing list