0
I'm working on a script for automating audio recording, using the 'dialog' command to create an interactive menu to appropriately name channels. I've got a list of the channel names in an array. I want the form itself to be blank, but I can't seem to pass the right parameters to dialog.
If I escape the quotes, the form appears as it should, but the quotes appear in the input area, If I don't escape the quotes, it results in a garbled mess, and if I echo the command to another file and execute it, it works exactly like I want. I need help figuring out how to get dialog to execute in that manner.
This is the code:
#!/bin/bash
declare -a CHANNELS
CHANNELS=(meet george jetson his boy elroy daughter judy)
channameiter ()
{
for i in ${!CHANNELS[@]};
do
echo -e "${CHANNELS[$i]}:" $((i + 1)) 1 \'\' $((i + 1)) 25 30 30 \
done
}
dialog --form "Channels" 30 60 16 `channameiter`
and this is the code echoed to another file, and then executed, which runs correctly.
dialog --form Channels 30 60 16 meet: 1 1 "" 1 25 30 30 george: 2 1 "" 2 25 30 30 jetson: 3 1 "" 3 25 30 30 his: 4 1 "" 4 25 30 30 boy: 5 1 "" 5 25 30 30 elroy: 6 1 "" 6 25 30 30 daughter: 7 1 "" 7 25 30 30 judy: 8 1 "" 8 25 30 30
Any ideas?