You have a menu with entries. Every entry uses the variable "out_dir" for something.slippery60 wrote:I am trying to write a menu system that will execute various cli programs. Many of the programs need a variable like "output directory" or 'out_dir".
So in their frame I include a variable "out_dir". I would like to propagate the answer to any one of the "out_dir" entries to all of them.
I thought that if is use just 1 variable "out_dir". After the first entry, a refresh would fix all of the "out_dir" variables and the user would not have to entry the variable again. But that didn't work.
Can this be done? and how?
Thanks
Code: Select all
menu
├─cli_1 >/${out_dir}
├─cli_2 >/${out_dir}
└─cli_3 >/${out_dir}
Code: Select all
export out_dir="whatever"
Code: Select all
menu
└─bash
export out_dir="whatever"
├─cli_1 >/${out_dir}
├─cli_2 >/${out_dir}
└─cli_3 >/${out_dir}
Didn't understand that part.slippery60 wrote: I would like to propagate the answer to any one of the "out_dir" entries to all of them.
Do you want to set the variable from the cli_1 and use it in cli_2?
Like Mochi-san said, code would tell much more.