[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
get back the expansion of ~ in associated array
From: |
Peng Yu |
Subject: |
get back the expansion of ~ in associated array |
Date: |
Mon, 17 Jul 2023 00:18:05 -0500 |
Hi,
In old bash, ~ can be expanded in an associated array.
$ bash --version | head -n 1
GNU bash, version 5.1.8(1)-release (x86_64-apple-darwin18.7.0)
$ declare -A x=([a]=~)
$ declare -p x
declare -A x=([a]="/Users/py" )
In new bash, ~ can be not expanded in an associated array. How to get
back the original behavior?
$ bash --version | head -n 1
GNU bash, version 5.2.15(1)-release (x86_64-apple-darwin21.6.0)
$ declare -A x=([a]=~)
$ declare -p x
declare -A x=([a]="~" )
--
Regards,
Peng