In this case, I'll be using dialog or whiptail.
The command I want to do is like this
whiptail --radiolist 'Example Prompt' 24 80 16 ???
Now, for ???, that's series of options in form of "OPTION" "Description of option" Off|On
So I'm trying to build a string (ahead of time) that would look like
"Option 1" "Description 1" Off "Option 2" "Description 2" Off "Option 3" "Description 3" Off
and so on forth.
How can I pass that including the quotes?
Things I've tried that does NOT work:
whiptail --radiolist 'Example Prompt' 24 80 16 ${varWithOptions}
whiptail --radiolist 'Example Prompt' 24 80 16 "${varWithOptions}"
What I tried that DID work:
eval "whiptail --radiolist 'Example Prompt' 24 80 16 ${varWithOptions}"
If possible, I'd like to avoid eval. Is there any way to do this otherwise? (Other than calling external commands, I'd like to keep it POSIX, and avoid any bashisms or similar.)
I want to stress that the string "Option 1" "Description 1" Off "Option 2" "Description 2" Off "Option 3" "Description 3" Off
I'm using as an example WILL be in a variable, as it's generated during the script execution, so anything requiring me to have that string hardcoded as part of a command will not work.