bug-bash
[Top][All Lists]
Advanced

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

Re: Empty strings disappear from array splice


From: Greg Wooledge
Subject: Re: Empty strings disappear from array splice
Date: Tue, 20 Jan 2015 08:15:29 -0500
User-agent: Mutt/1.4.2.3i

On Mon, Jan 19, 2015 at 03:22:36PM -0800, address@hidden wrote:
> Here is the minimal code sample to reproduce the bug (present in version 4.2, 
> corrected in 4.3 as far as I can tell) :
> 
>   arr1=( "" "" )
>   arr2=( "address@hidden:1}" )

Seems to be either a Debian-specific bug, or a bug that was fixed in a
later patch than Debian is using.

On Debian:

address@hidden:~$ echo "$BASH_VERSION"
4.2.37(1)-release
address@hidden:~$ arr1=( "" "" )
address@hidden:~$ arr2=( "address@hidden:1}" )
address@hidden:~$ declare -p arr1 arr2
declare -a arr1='([0]="" [1]="")'
declare -a arr2='()'

On HP-UX with bash compiled straight from source:

imadev:~$ bash-4.2
imadev:~$ echo "$BASH_VERSION"
4.2.46(1)-release
imadev:~$ arr1=( "" "" )
imadev:~$ arr2=( "address@hidden:1}" )
imadev:~$ declare -p arr1 arr2  
declare -a arr1='([0]="" [1]="")'
declare -a arr2='([0]="")'



reply via email to

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