[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bash-bug
Subject:    Re: Wrong variable expansion inside quotation marks
From:       Chet Ramey <chet.ramey () case ! edu>
Date:       2008-02-14 3:55:22
Message-ID: 47B3BBAA.7050808 () case ! edu
[Download RAW message or body]

Reuti wrote:
> Hi,
> 
> I have one system with:
> 
> reuti@theochem:~> bash --version
> GNU bash, version 3.00.16(1)-release (i586-suse-linux)
> Copyright (C) 2004 Free Software Foundation, Inc.
> 
> reuti@theochem:~> hallo=hallo
> reuti@theochem:~> rr=r
> reuti@theochem:~> tt="${rr:0:${#rr}-1}$hallo"
> reuti@theochem:~> echo ${#tt}
> 5
> 
> This is what I expect. But in an newer bash:
> 
> reuti@marc-hn:~$ bash --version
> GNU bash, version 3.1.17(1)-release (x86_64-pc-linux-gnu)
> Copyright (C) 2005 Free Software Foundation, Inc.
> 
> reuti@marc-hn:~$ hallo=hallo
> reuti@marc-hn:~$ rr=r
> reuti@marc-hn:~$ tt="${rr:0:${#rr}-1}$hallo"
> reuti@marc-hn:~$ echo ${#tt}
> 6

The current version of bash (3.2.33) behaves correctly, like bash-3.0.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		       Live Strong.  No day but today.
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic