Link to home
Start Free TrialLog in
Avatar of Adrian Dobrota
Adrian DobrotaFlag for Romania

asked on

bash script - dialog

I am writing a quite complex (for me) interface using dialog.
I was wondering if anyone can provide a solution for the following situation:
Instead of creating a fix list of items in a menu like this:

dialog --title "bla" --menu "bla2 " 11 60 4 \
   "1" "selection 1" \
   "2" "selection 2" \
   "3" "selection 3 \
   "4" "Exit" 2>/tmp/x

I need a VARIABLE list of items
Of course, the dimension of the dialog box can be automatically resized using 0 0 0 as dimension, however I see no solution to getting menu entries from a loop.

It should look like:
dialog --title "bla" --menu "bla2 " 0 0 0 \
for i in 1 2 3 4 5
 do
   "$i" "selection $i" \
 done
 "E" "Exit" 2>/tmp/x
Since there's no way AFAIK to introduce a for/while loop inside the dialog body, I'm looking for an alternative.

Anyone can give one?
Thank you
ASKER CERTIFIED SOLUTION
Avatar of tty2
tty2
Flag of Ukraine image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Adrian Dobrota

ASKER

Thank you, exactly what I was looking for.