Re: bash-3 incompatibility: quoting in pattern substitution of variables
From:
Stephane Chazelas
Subject:
Re: bash-3 incompatibility: quoting in pattern substitution of variables
Date:
Tue, 7 Sep 2004 09:21:58 +0100
User-agent:
Mutt/1.5.6i
On Mon, Sep 06, 2004 at 06:15:27PM +0200, Harald Koenig wrote:
[...]
> now I'm still curious if my code was (or is) wrong and I have to use
> you version in the future, or if bash-3 is buggy and sometime there
> will be a fix and my code will work again like with bash-2 ?
[...]
Your code is correct, but I'd rather say that bash2 was buggy or
incomplete and that bash3 fixed its behavior (in a way that is
not backward compatible), but I'm not a bash developer.
Other different behaviors:
pattern='?'
var='A?'
echo ${var//$pattern/B} ${var//"$pattern"/B}
Now more consistent with the ${var%"$pattern"} and compatible
with ksh93 and zsh's (k)sh emulation
--
Stephane
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________