STATUS QUO
i have an external properties file, where a couple of variables are stored. one of these has a list of values (min 1 value, max X values).
when declaring this single list within the shell script, it would look like this:
NODES=(
"node"
"node-2"
"node-3"
)
I read the values from the properties file like this:
# checks, if file exists and is readable
file="./properties.credo"
if [ ! -r "$file" ]
then
echo "fatal: properties file $file not found / readable."
exit 2
fi
# loads properties into variables
. $file
[[ -z "$VALUEA" ]] && echo "fatal: VALUEA not specified in .credo" && exit 2
...
PROBLEM
When defining the NODES values in the properties like this:
NODES=node,node-2,node-3
... and reading with that:
...
[[ -z "$NODES" ]] && echo "fatal: NODES not specified in .credo" && exit 2
...
... it will be read from the file as a single string node,node-2,node-3
, but not as a list or one-dimensional array.