[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#240887: Package building problem.



clone 240887 -1
retitle 240887 backslashes are literal in shell bracket expressions
reassign 240887 tetex-bin
reassign -1 autoconf
quit

On Thu, Apr 15, 2004 at 03:10:58PM +0100, Colin Watson wrote:
> 
> fnmatch(3) references glob(7), which says:
> 
>    Character classes
>        An expression `[...]' where the first character after the lead-
>        ing `[' is not an `!' matches a single character, namely any of
>        the characters enclosed by the brackets.  The  string  enclosed
>        by  the  brackets cannot be empty; therefore `]' can be allowed
>        between the brackets, provided that it is the first  character.
>        (Thus,  `[][!]' matches the three characters `[', `]' and `!'.)
> 
>    ...
> 
>        One  can remove the special meaning of `?', `*' and `[' by pre-
>        ceding them by a backslash, or, in case this is part of a shell
>        command line, enclosing them in quotes.  Between brackets these
>        characters stand for themselves.  Thus,  `[[?*\]'  matches  the
>        four characters `[', `?', `*' and `\'.
> 
> Accordingly, I believe that the pattern in your example means
> "backslash, followed by a, followed by closing square bracket", not what
> you think it means.

You're quite right.  This is reaffirmed by the POSIX document for
basic regular expressions, which is what POSIX uses to define
shell patterns.

Therefore tetex-bin and autoconf will need to be fixed instead to
not use backslashes in [] expressions.
-- 
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



Reply to: