I’m retrieving a list of items using CURL in this format into a file:
USA, Colorado, Denver
USA, Colorado, Denver (LOC1 S3)
USA, Florida
USA, Florida (LOC1 S2)
I need to show that list in a dialog (e.g. using Zenity) and pick one line to then use it as variable in a command e.g.
selloc = *prompt here*
dosomething "$selloc"
which would execute
dosomething "USA, Colorado, Denver (LOC1 S3)"
How can I do that?
http://linux.byexamples.com/archives/265/a-complete-zenity-dialog-examples-2/ has examples of how to display “radio list” or “checkbox list” dialogs with Zenity.
Obtaining the list of options from a file should be doable with
xargsoreval.