help-bash
[Top][All Lists]
Advanced

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

[Help-bash] Why empty key is not allowed?


From: Peng Yu
Subject: [Help-bash] Why empty key is not allowed?
Date: Sat, 21 Sep 2019 18:18:40 -0500

Hi,

I am trying to assign an empty key to an associated array.

$ declare -A x
$ x[]=1
-bash: x[]: bad array subscript

But I got this error. Is it not allowed? Or I am not doing it correctly?

The manpage says this. So empty string should be allowed?

"associative arrays are referenced using arbitrary strings."

Thanks.

-- 
Regards,
Peng



reply via email to

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