bug-bash
[Top][All Lists]
Advanced

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

Re: BUG about quote removal inside parameter expansion.


From: Chet Ramey
Subject: Re: BUG about quote removal inside parameter expansion.
Date: Thu, 7 Nov 2002 08:56:50 -0500

> Machine Type: i386-pc-linux-gnu
> 
> Bash Version: 2.05b
> Patch Level: 0
> Release Status: release
> 
> Description:
>       This bug is about quote removal inside parameter expansion.

It's not a bug.

>       The one I experienced the bug with is the substitution one:
>         ${variable/pattern/string}
>         ${variable//pattern/string}
>       but AFAIK other parameter expansions could have the same problem.
> 
>       1st bug: (documentation bug) It's not clear which quotes or
>                expansions can be performed inside the pattern and the
>                string parts.
>       2nd bug: (real bug) If some of them are tried, they generally
>                work, but THE QUOTES AREN'T REMOVED. See the example
>                below.

Think of your example as being identical to `echo "${hello//r/' '}"'
with a literal TAB between the single quotes (which it is).  The
single-quoted string is within double quotes.  Inside double quotes,
single quotes are retained. 

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )

Chet Ramey, ITS, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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