[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
correct error message?
From: |
L A Walsh |
Subject: |
correct error message? |
Date: |
Sat, 26 Nov 2016 13:01:36 -0800 |
User-agent: |
Thunderbird |
I was checking to see if an associative array had a member:
echo $BASH_VERSION
4.4.5(1)-release
declare -A requires=([squid]="-d /var/cache/squid/run")
This works as expected:
if [[ ${requires[xxx]:-} ]]; then echo ok; else echo not; fi
not
But this didn't (misspelling of hash name):
if [[ ${requirs[xxx]:-} ]]; then echo ok; else echo not; fi
bash: xxx: unbound variable
Shouldn't it have said:
bash: requirs: unbound variable?
- correct error message?,
L A Walsh <=