Re: Indices of array variables are sometimes considered unset (or just display an error).

2018-11-05 Thread Grisha Levit
On Mon, Nov 5, 2018 at 10:38 PM Eduardo Bustamante wrote: > Sorry, I'm having a hard time following this email thread. I *think* the point is that OP expected that: (a) ${!var[@]-foo} expands to the indexes of var if ${var[@]} if set, else to `foo' whereas the behavior they observed is: (b

Re: Indices of array variables are sometimes considered unset (or just display an error).

2018-11-05 Thread Eduardo Bustamante
On Mon, Nov 5, 2018 at 6:01 PM Great Big Dot wrote: (...) > > [... A]ccessing the index list of multiple-element arrays > > fails when you append the unset expansion. With single-element > > arrays, it fails iff the element in question contains any special > > characters or whitespace, and thinks

Re: Indices of array variables are sometimes considered unset (or just display an error).

2018-11-05 Thread Great Big Dot
> On Mon, Nov 5, 2018 at 4:56 PM Great Big Dot wrote: > [... A]ccessing the index list of multiple-element arrays > fails when you append the unset expansion. With single-element > arrays, it fails iff the element in question contains any special > characters or whitespace, and thinks the array is

Re: Indices of array variables are sometimes considered unset (or just display an error).

2018-11-05 Thread Great Big Dot
On Mon, Nov 5, 2018 at 4:56 PM Great Big Dot wrote: > The parameter expansion "${!var[@]}" expands to the indices of an array (whether linear or associative). Hold up... when I view this email on the public archives, all of my "${array[@]}"'s (that is, "${array[]}"'a) got turned to "address@hidde

Indices of array variables are sometimes considered unset (or just display an error).

2018-11-05 Thread Great Big Dot
uname output: Linux ArchBox0 4.18.16-arch1-1-ARCH #1 SMP PREEMPT Sat Oct 20 22:06:45 UTC 2018 x86_64 GNU/Linux Machine Type: x86_64-unknown-linux-gnu Bash Version: 4.4 Patch Level: 23 Release Status: release --text follows this line-- Description: The parameter expansion "${!var[@]}" expan

Re: printf '\uFEFF' outputs invalid UTF-8 on Windows

2018-11-05 Thread Chet Ramey
On 11/5/18 12:09 PM, Kalle Olavi Niemitalo wrote: > Bash Version: 4.4 > Patch Level: 19 > Release Status: release > > Description: > The builtin printf '\uFEFF' outputs ED 9F BF ED BB BF in a > UTF-8 locale on Microsoft Windows, where sizeof(wchar_t) == 2. > It should outp

printf '\uFEFF' outputs invalid UTF-8 on Windows

2018-11-05 Thread Kalle Olavi Niemitalo
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: msys Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='msys' -DCONF_MACHTYPE='x86_64-pc-msys' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -