bug-bash
[Top][All Lists]
Advanced

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

Re: Wrong variable expansion inside quotation marks


From: Chet Ramey
Subject: Re: Wrong variable expansion inside quotation marks
Date: Wed, 13 Feb 2008 22:55:22 -0500
User-agent: Thunderbird 2.0.0.9 (Macintosh/20071031)

Reuti wrote:
Hi,

I have one system with:

address@hidden:~> bash --version
GNU bash, version 3.00.16(1)-release (i586-suse-linux)
Copyright (C) 2004 Free Software Foundation, Inc.

address@hidden:~> hallo=hallo
address@hidden:~> rr=r
address@hidden:~> tt="${rr:0:${#rr}-1}$hallo"
address@hidden:~> echo ${#tt}
5

This is what I expect. But in an newer bash:

address@hidden:~$ bash --version
GNU bash, version 3.1.17(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.

address@hidden:~$ hallo=hallo
address@hidden:~$ rr=r
address@hidden:~$ tt="${rr:0:${#rr}-1}$hallo"
address@hidden:~$ 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    address@hidden    http://cnswww.cns.cwru.edu/~chet/





reply via email to

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