Sponsored Content
Full Discussion: Dialog menu with array
Homework and Emergencies Homework & Coursework Questions Dialog menu with array Post 303010300 by dan007255 on Friday 29th of December 2017 10:58:07 AM
Old 12-29-2017
Dialog menu with array

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

1. The problem statement, all variables and given/known data:

Hi

I'm currently making a schoolproject and I'm stuck with reading an array into the possible options of a menu dialog. What I mean is: I've put some values into an array, I want all these values from the array to be possible to be selected in the menu. I'm npot sure how many options should be available, so i use the array length. Please help Smilie
I'm programming in Debian and I use bash.

Thanks

variables:
array muzieklijst[]
mpg123 is for playing the song

2. Relevant commands, code, scripts, algorithms:

dialog --menu "title" width height optionsammount\
option1 \
option 2 \
option 3 \
...

3. The attempts at a solution (include all code and scripts):

Code:
dialog --menu "Choose song" 25 75 ${#muzieklijst[@]} \
        for j in $(`cat muzieklijst.txt`) ; do
            echo ""$j" \\"
        done 2> outputspeler.txt
        for (( i=0; i<${#muzieklijst[@]}; i=$i=1))
        do
            if [ "$muzieklijst[i]" = `cat outputspeler.txt` ]
            then
                mpg123 muziekpadlijst[$i]
                continue
            fi
        done

4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):

Odisee Technologiecampus Ghent, Ghent, Belgium, Joris Maervoet, B-ODISEE-JLW375-1718

Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).

---------- Post updated at 04:58 PM ---------- Previous update was at 04:41 PM ----------

I have to add, that I'm allowed to get help if I write where I got help from.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Interactive Array Menu

This should be simple, but i haven't done it before... KSH I am reading a file into an array and currently displaying the values to the screen. What I need to do is to display a subset of those values, likely numbered, and prompt the user to select one. When they enter the number, it... (2 Replies)
Discussion started by: gecko2424
2 Replies

2. Shell Programming and Scripting

Menu help with array selection

Hi there all I got the following I got multiple arrays named for example STAT_AAAA STAT_AAAB STAT_AAAC STAT_AAAD Now what I want I have chosen an option in a menu to select 1 but I dont want to write for all the same thing so I made it a signle one now what I want is to get STAT_ and... (6 Replies)
Discussion started by: draco
6 Replies

3. Shell Programming and Scripting

Unix / Linux Dialog Utility - how to open 2+ more dialog windows ?

Hi, example of Unix / Linux dialog utility is below. I am going to use dialog as simple GUI for testing of a modem. So I need to combine some dialog boxes into one. I need to have input box, output box, info box, dialog box, radiobox as in any standard program with graphical user... (2 Replies)
Discussion started by: jack2
2 Replies

4. Shell Programming and Scripting

dialog menu script. please HELP

hello. i want to create a useradd dialog menu. i cannot make a single menu with 4 box inputs ( user, pass, fullname, shell ) because the dialog utility is either limited or either i know to less about using the dialog utility. from what i see it only allows me to post these 4 boxes one by one,... (3 Replies)
Discussion started by: claudlu
3 Replies

5. Shell Programming and Scripting

Menu in Menu script issue

Problem: I am trying to create a menu in a menu script and I am running into an issue with the calculator portion of the script. I am first presented with the ==Options Menu== which all 5 options working correctly. Now comes the fun part. I select option 1 which takes me to my ==Calculator... (1 Reply)
Discussion started by: iDdraig
1 Replies

6. Shell Programming and Scripting

Need help in create menu with 3 sub menu using the case command

hi all i am a newbie to this is there any examples on creating a main menu with 3 sub menu main menu -> option a , b and c a menu -> option 1 ,2 and 3 b menu -> option 1 ,2 c menu -> option 1 ,2 i am getting headache as my code kept getting unexpected EOF ---------- Post... (0 Replies)
Discussion started by: chercm
0 Replies

7. Shell Programming and Scripting

Dialog --menu limitation for the entries for selection

Hi Guys, Please pardon me if this is a silly question, but I have tried to find an answer and going through the man page and failed to get one. I have created a menu driven script with dialog --menu option. Everything is working as expeted, however, it seems that if I have more than 10... (1 Reply)
Discussion started by: ww889
1 Replies

8. Shell Programming and Scripting

Dialog menu with array

Hi I'm currently making a schoolproject and I'm stuck with reading an array into the possible options of a menu dialog. What I mean is: I've put some values into an array, I want all these values from the array to be possible to be selected in the menu. Please help :) I'm programming in Debian... (1 Reply)
Discussion started by: dan007255
1 Replies

9. Shell Programming and Scripting

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: DynamicEntry=$(whiptail \ --title "DEBUG... (1 Reply)
Discussion started by: annacreek
1 Replies

10. UNIX for Beginners Questions & Answers

Gnome 3.28.3 menu item dissapears under the system menu

I installed CentOS 8 with Gnome 3.28.2 and I noticed that the "switch user" menu item disappeared from under the system menu of Gnome classic (Both X11 & Wayland). I checked google and this problem seems to have a history going back several releases of Gnome. Unfortunately, I never found a... (1 Reply)
Discussion started by: bodisha
1 Replies
DH_INSTALLMENU(1)						     Debhelper							 DH_INSTALLMENU(1)

NAME
dh_installmenu - install Debian menu files into package build directories SYNOPSIS
dh_installmenu [debhelperoptions] [-n] DESCRIPTION
dh_installmenu is a debhelper program that is responsible for installing files used by the Debian menu package into package build directories. It also automatically generates the postinst and postrm commands needed to interface with the Debian menu package. These commands are inserted into the maintainer scripts by dh_installdeb(1). FILES
debian/package.menu Debian menu files, installed into usr/share/menu/package in the package build directory. See menufile(5) for its format. debian/package.menu-method Debian menu method files, installed into etc/menu-methods/package in the package build directory. OPTIONS
-n, --no-scripts Do not modify postinst/postrm scripts. SEE ALSO
debhelper(7) update-menus(1) menufile(5) This program is a part of debhelper. AUTHOR
Joey Hess <joeyh@debian.org> 11.1.6ubuntu2 2018-05-10 DH_INSTALLMENU(1)
All times are GMT -4. The time now is 01:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy