Here is a code snippet using whiptail , it fails to complete giving me long list of options available for whiptail .
That is great, but how do I determine which of the current opinions is wrong?
I did tried inserting comment (#) into options and it just did not work.
Deleting the option created another errors.
So in case of "checklist" - can I start with minimum code which would compile and then add "options" to it ?
Cheers
PS
My main problem using bash is having or not having spaces in right places.
That is hard on old eyes. Maybe that is the issue here.
on line 104 you are reading the contents of file results and whiptail output is being re-directed to file choices.
Note that this file name will cause issues if you have 2 processes running the script at the same time. Can I suggest you use /tmp to store the output file and give it a unique name eg using $$ for the process ID eg:
on line 104 you are reading the contents of file results and whiptail output is being re-directed to file choices.
Note that this file name will cause issues if you have 2 processes running the script at the same time. Can I suggest you use /tmp to store the output file and give it a unique name eg using $$ for the process ID eg:
Last edited by annacreek; 08-13-2018 at 02:12 PM..
Whiptail produces output on stderr that indicates the interactions taken by the user. Your script works by redirecting this output to a file as hi-lighted below:
Run the above code and make various choices in the dialog and then check the contents of the whiptail.out file.
So after the user has selected their preferences these need to be read in from the file and acted upon.
The above code fragment loops for each line of the file whiptail.out setting the variable choice to the contents of the line.
You can take particular actions based on the file contents using something like a case statement within the while loop eg:
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)
I like to “optimize” / make more like a real program my bash script by replacing repetitious code which utilizes positional parameters.
I am having two issues I cannot solve and would appreciate some assistance with resolving them.
a) how to modify the whiptail checklist... (3 Replies)
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)
Evening, I'd like to point out I am very much new to anything regarding scripting, so I apologize If I am / will ask stupid questions.
I am currently trying to design a script that will completely setup a server for a group that needs one, so that they can have a easy way of getting up and... (8 Replies)
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)
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)
Hello all,
Can somebody please tell what is the best book out there that can help me learn TCP troubleshooting and understaning the TCP options like window scaling, large receive offload? I would like to understand how all the TCP tuning parameters function. Is there a book out there that can... (4 Replies)
I have a question regarding "whiptail utility" in Linux.
I have the following whiptail command within a script:
#!/bin/sh
whiptail --passwordbox " Password " 10 40
I would like to know Where does it store the password when the script is run?
Does it go to any particular file? How... (1 Reply)
I have a question regarding "whiptail utility" in Linux.
I have the following whiptail command within a script:
#!/bin/sh
whiptail --passwordbox " Password " 10 40
I would like to know Where does it store the password when the script is run?
Does it go to any particular file? How... (1 Reply)
Hi.
I have a Solaris 10 server that's taking about 20secs to respond to telnet or ftp commands. Has anyone ever seen something like that? Can you tell me where to start troubleshooting please? I logged in and did a prtstat, but nothing is jumping out as an issue. (8 Replies)