bug-bash
[Top][All Lists]
Advanced

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

Re: Bug report: extended pattern match bug (or "feature" [sic] /inconsis


From: Chet Ramey
Subject: Re: Bug report: extended pattern match bug (or "feature" [sic] /inconsistency)
Date: Thu, 25 Mar 2004 17:12:34 -0500

> > and unquote the expansion.
> >  
> >
> The expansion is unquoted:
> 
>  cur=$a-+([-0-9.a-z])$b

Pathname expansion is not performed on the rhs of assignment
statements, unquoted or not.  It's the expansion of that variable that
causes pathname expansion to be performed.

> I'll show you a different example that uses no quotes but still shows the 
> difference:
> 
> > export cur=$a-+([-0-9.a-z])$b

This is not an assignment statement; it's an argument to `export' that
happens to look like an assignment statement, so pathname expansion is
performed.

The short example I gave in my reply was intended to demonstrate that:
assignment statements do not cause pathname expansion to be performed
on the rhs; quoting a variable whose value contains a pattern matching
character inhibits pathname expansion; and that pathname expansion is
performed on the results of an unquoted variable expansion.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    chet@po.cwru.edu    http://tiswww.tis.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]