Passing positioning array as whiptail -- menu option


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Passing positioning array as whiptail -- menu option
# 1  
Old 09-04-2018
Passing positioning array as whiptail -- menu option

I may have asked this before, so forgive OF.
Problem:
I can pass positioning array as -- menu option to whiptail, but it does not show in the whiptail form as an array - only single (first member "lsusb" ) entry / line shows up.



Code:


Code:
DynamicEntry=$(whiptail \
--title "DEBUG Dynamic menu build from file $LINENO" \
--backtitle "Current work in progress file $0 " \
--menu "Setup Options"  $WT_HEIGHT $WT_WIDTH $WT_MENU_HEIGHT \
--default-item "10 DEBUG Enable debug " \
 --cancel-button Finish \
 --ok-button Select \
"${arraySYSTEM[@]}" "${arraySYSTEM[@]}"              \
"$arraySYSTEM[$@]" "$arraySYSTEM[$@]"               \
3>&1 1>&2 2>&3)


Partial terminal output :
Code:
++ whiptail --title 'DEBUG Dynamic menu build from file 4863' --backtitle 'Current work in progress file /usr/bin/raspi-config-DEBUG.sh ' --menu 'Setup Options' 17 80 10 --default-item '10 DEBUG Enable debug ' --cancel-button Finish --ok-button Select 'lsusb
command desciption default text 
CLI command default description
8 CLI Command
6 CLI Command
4 CLI Command
32 CLI Command
30 CLI Command
2 CLI Command
28 CLI Command
26 CLI Command
24 CLI Command
22 CLI Command
20 CLI Command
18 CLI Command
16 CLI Command
14 CLI Command
12 CLI Command
10 CLI Command' 'lsusb
command desciption default text 

10 CLI Command' 'lsusb
command desciption default text 
CLI command default description
8 CLI Command
6 CLI Command
4 CLI Command
32 CLI Command
30 CLI Command
2 CLI Command
28 CLI Command
26 CLI Command
24 CLI Command
22 CLI Command
20 CLI Command
18 CLI Command
16 CLI Command
14 CLI Command
12 CLI Command
10 CLI Command' 'lsusb
command desciption default text 
CLI command default description
8 CLI Command


Notes:
I used two different syntaxes and neither one shows up as full array.
Since --menu requires TWO strings I just duplicated SAME entries.



The array is loaded as --menu option correctly , but does not show in menu GUI



What did I missed ?



Thanks for help.
# 2  
Old 09-04-2018
This thread seems to be a duplicate of the thread Getting data from file to positioning parameters. Any comments on this topic should be posted in that thread.
This User Gave Thanks to Don Cragun For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Putting strings into positioning array in loop

i need to add 2 string variables into a positioning array , repeatedly - in loop. First string in $2, second to $3 then up to the desired count incrementing the "position". Using set -- alone does not increment the count so I end up with 2 variables in the array. How do I increment the... (7 Replies)
Discussion started by: annacreek
7 Replies

2. Shell Programming and Scripting

Redirecting stdout output to whiptail menu box

As a result of whiptail menu option I am getting a data from a file. Naturally it is output to terminal as stdour. I like to redirect the output back to the menu. It can be done with single input of line of text , see attached. I just cannot see where or how the sample... (0 Replies)
Discussion started by: annacreek
0 Replies

3. Shell Programming and Scripting

Need Menu option each on a new line

Here is my script for the menu options. # Bash Menu Script Example PS3='Please enter your choice: ' options=("Option 1:" "Option 2:" "Other Reason:" "Quit") select opt in "${options}" do case $opt in "Option 1 :") echo "you chose choice 1" ;; ... (3 Replies)
Discussion started by: mohtashims
3 Replies

4. Shell Programming and Scripting

Bash Script - Whiptail Menu Help!

Hello, Been trying to build a menu with whiptail lately. However, my code doesn't seems to be working even though when i compared to other similar code they looks the same. #!/bin/bash clear whiptail --msgbox "Entering networking sub-menu" 20 78 whiptail --title Networking --menu... (8 Replies)
Discussion started by: malfolozy
8 Replies

5. Shell Programming and Scripting

sh file: READ (menu) but now run with option

I have a script which uses READ to detect choice of menu option...now I want to change the script without doing whole rewrite such that when user runs ./script.sh 5 it would execute menu option 5 rather than user running ./script.sh waiting for it to load and then pressing "5 enter" Is it... (1 Reply)
Discussion started by: holyearth
1 Replies

6. Shell Programming and Scripting

Whiptail menu, getting back the variable

Hi all Only learning so if any mistakes, let me know I am trying to create a menu box with Whiptail, taking in the variables from a txt.file called Name.txt which has just 4 names listed for now, one below each other..ie Dave John Mike Mary Bash script is below and calls the txt... (8 Replies)
Discussion started by: olearydc
8 Replies

7. Ubuntu

Add Option To Right Menu

hey all, I already installed nautilus-actions now , I want to add "print path" script(option) to the right context menu!.. I did : http://img853.imageshack.us/img853/6973/59818245.png http://img847.imageshack.us/img847/8758/37217230.png the script print located in... (2 Replies)
Discussion started by: eawedat
2 Replies

8. Shell Programming and Scripting

How do I add the option to change the path in a menu?

How do I add the option to change the path in a menu? I have this script. The user chooses a number and had the option of doing something, looking for log files etc. There is a possibility they might want to look at a different path other than what I have given them such as... (2 Replies)
Discussion started by: taekwondo
2 Replies

9. Shell Programming and Scripting

Unix Shell Script: With Menu Option

I am attempting to create a shell script with the following capaciblities: 1. Listed options to choice from 2. Use to perform awk statements 3. Print a report with the awk results My questions are 1. How do I select more than one file for option #5 and #6 2. How to I create an... (11 Replies)
Discussion started by: jroberson
11 Replies

10. Shell Programming and Scripting

a main menu option?

I have created a main menu in the following way: while true; do echo " " echo "Main Menu: " echo "Please Select An Option Using The Options Provided." echo " " echo "1 - Search All Files" echo " " echo "2 - Search Individual Files" echo " " ... (1 Reply)
Discussion started by: amatuer_lee_3
1 Replies
Login or Register to Ask a Question