I have the following dialog radiolist, which works fine.
#!/bin/bash
ch1a="1"
ch1b="Fri, 20/3/15"
ch2a="2"
ch2b="Sun, 21/6/15"
ch1="\"$ch1a\" \"$ch1b\""
dialog --title "Equinoxes and Solistices" \
--radiolist "When is the Winter Solictice?" 15 60 4 \
"$ch1a" "$ch1b" ON \
"$ch2a" "$ch2b" OFF \
"3" "Wed, 23/9/15" OFF \
'4' 'Mon, 21/12/15' OFF 2>/tmp/menu.sh.$$
However, if I substitute the first choice with "$ch1"
or "${ch1[@]}"
, even with different definitions of ch1
, I get no result.
My final goal is to create a dynamic radiolist, with all the choices included is a string or an array. I have already tried this solution, but it does not work when the choices contain blanks.
Is there any way to add more choices, using a for-loop, or by using the length of the array as a maximum of choices?
– Theo Apr 21 '15 at 14:02