I want to create a simple dialog with bash-dialog. I work with (X)DSL and bash-3.2. The latest (X)DSL is based on Linux 2.4.31 and comes with bash-2.05, however, bash-3.2 is downloadable from MyDSL/Testing. So, my script runs under '#!/bin/bash-3.2/bin/bash'.
The menu items the users can choose from come from a database.
Example database file 'armatures':
Indoor Lighting|Lighting for Indoor use
Outdoor Lighting|Lighting for Outdoor use
I retrieve the data into an array 'options' from the 'armatures' file with:
options=($(awk -F"|" '{ print $1,$2 }' armatures)
and in terminal 'echo' the array:
echo ${options[@]}
which shows:
"Indoor Armatures" "Lighting for Indoor use" "Outdoor Armatures" "Lighting for Outdoor use"
This looks OK to use as a selection menu with 'whiptail' but it isn't. The command line:
whiptail --clear --title "Armatures" --menu "Choose an armature" 50 80 10 ${options[@]}
shows:
column1-column2
Indoor-Armatures
Lighting-for
Indoor-use
Outdoor-Armatures
Lighting-for
Outdoor-use
in stead of:
column1-column2
Indoor armatures-Lighting for Indoor use
Outdoor armatures-Ligthing for Outdoor use
It seems that array elements with double quotes are ignored or not seen by 'whiptail'. I also tried "${options[@]}" but that always results on the first word 'Indoor'.
Aside from 'whiptail' I tried 'dialog' but they are the same: version information shows 'cdialog (ComeOn Dialog!) version 1.1-20080316' in both cases.
I have very limited resources and don't want to venture (yet) into 'xdialog', 'zenity', 'dzen' and the like, even if that would solve this. I am also limited to Linux 2.4.31 due to XDSL (for XBOX).
I've been browsing the Internet a lot but to no avail. What could be the solution with 'whiptail/dialog'?