From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonatan Schlag To: development@lists.ipfire.org Subject: [PATCH 09/21] tests/lib.sh: Use namref to access an array Date: Mon, 20 May 2024 11:05:59 +0200 Message-ID: <20240520090611.10406-10-jonatan.schlag@ipfire.org> In-Reply-To: <20240520090611.10406-1-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7691862703853650986==" List-Id: --===============7691862703853650986== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable ! does not work here. So the solution here is: https://unix.stackexchange.com/questions/60584/how-to-use-a-variable-as-part-= of-an-array-name/60585#60585 Signed-off-by: Jonatan Schlag --- tests/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lib.sh b/tests/lib.sh index 006862da6..ad7c12cb0 100644 --- a/tests/lib.sh +++ b/tests/lib.sh @@ -28,7 +28,7 @@ var_has_value() { } =20 test_that_key_in_arry_has_value() { - local array=3D"${!1}" + local -n array=3D"${1}" local arrayname=3D"${1}" local key=3D"${2}" local value=3D"${3}" --=20 2.39.2 --===============7691862703853650986==--