On Tue, 15 Feb 2011, Chet Ramey wrote:
On 2/15/11 6:18 AM, Clark J. Wang wrote:
For following script:
var='[hello'
echo "${var//[/}"
With bash 4.1 it outputs hello but with 4.2 it outputs [hello . And bash 4.2
with compat41 on still outputs [hello . Bug? Or Bug fixed?
It's a bug, and I will release a patch. In the meantime, see if the
attached patch does the right thing on your platform.
On Mandriva, I get '[hello'; after applying the patch I get 'hello'.
--
Chris F.A. Johnson, <http://cfajohnson.com/>
Author:
Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)