Sponsored Content
Full Discussion: Troubleshooting whiptail
Top Forums Shell Programming and Scripting Troubleshooting whiptail Post 303021638 by annacreek on Monday 13th of August 2018 06:26:49 PM
Old 08-13-2018
I have build a new function with limited scaffold.

It 'runs" with an error @ line 67, not sure if I should be concerned about the error at

this time.



I know how it suppose to work, the part I do not understand is

where does the file "choice" @ line 58 come from.



The selection is in "results" and I am reading "choice".

It just " does not compute ".





As written now I have deliberately deleted lines of code between lines 60 and 61 -

no selection from menu is implemented.



However

I do expect lines 60 and 61 to execute to indicate that the process went thru them.
THAT is the issue - if I add the " do /done" selection code it never gets processed and

I DO NOT understand why.



Code:
                         whiptail_DEBUG(){
   44 echo " whiptail_DEBUG  @ line $LINENO"
   45 echo "Passed parameter #1 is $1"
   46 echo "Passed parameter #2 is $2"
   47 echo "Passed parameter #3 is $3"
   48 echo "Passed parameter #4 is $4"
   49 whiptail \
   50 --title "$1" \
   51 --separate-output  \
   52 --checklist  "Choose: " 20 78 15 \
   53 "$2" "" on  \
   54 "$3" "" off \
   55 "$4" "" off
   56 2>results               selection goes here 



   57 echo "function whiptail_DEBUG  @ line $LINENO"
   58 while read choice                  why am I reading "choise" and not "results" ? 

   59 do
   60 echo "START do/ while read @ Line $LINENO read  $choice"
   61 echo "END   do/ while read @ Line $LINENO read  $choice"
   62 done < results
   63 echo "czech file results  @ Line $LINENO "
   64 if [ $exitstatus = 0 ]; then
   65 echo "TOK " $choice
   66 else
   67 echo "function status failed "
   68 fi
   69 echo "function  whiptail_DEBUG  @ line $LINENO"
   70 }

 

10 More Discussions You Might Find Interesting

1. Solaris

help troubleshooting

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)
Discussion started by: bbbngowc
8 Replies

2. Red Hat

whiptail --password : How does it work?

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)
Discussion started by: Vabiosis
1 Replies

3. Shell Programming and Scripting

Questions: whiptail --passwordbox

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)
Discussion started by: Vabiosis
1 Replies

4. IP Networking

TCP/IP troubleshooting

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)
Discussion started by: Pouchie1
4 Replies

5. 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

6. 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

7. Shell Programming and Scripting

Whiptail "Command not found"

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)
Discussion started by: KeyXMakerX
8 Replies

8. 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

9. Shell Programming and Scripting

Use positional parameters in loop / while syntax in whiptail

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)
Discussion started by: annacreek
3 Replies

10. 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
APC_CAS(3)								 1								APC_CAS(3)

apc_cas - Updates an old value with a new value

SYNOPSIS
bool apc_cas (string $key, int $old, int $new) DESCRIPTION
apc_cas(3) updates an already existing integer value if the $old parameter matches the currently stored value with the value of the $new parameter. PARAMETERS
o $key - The key of the value being updated. o $old - The old value (the value currently stored). o $new - The new value to update to. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 apc_cas(3) example <?php apc_store('foobar', 2); echo '$foobar = 2', PHP_EOL; echo '$foobar == 1 ? 2 : 1 = ', (apc_cas('foobar', 1, 2) ? 'ok' : 'fail'), PHP_EOL; echo '$foobar == 2 ? 1 : 2 = ', (apc_cas('foobar', 2, 1) ? 'ok' : 'fail'), PHP_EOL; echo '$foobar = ', apc_fetch('foobar'), PHP_EOL; echo '$f__bar == 1 ? 2 : 1 = ', (apc_cas('f__bar', 1, 2) ? 'ok' : 'fail'), PHP_EOL; apc_store('perfection', 'xyz'); echo '$perfection == 2 ? 1 : 2 = ', (apc_cas('perfection', 2, 1) ? 'ok' : 'epic fail'), PHP_EOL; echo '$foobar = ', apc_fetch('foobar'), PHP_EOL; ?> The above example will output something similar to: $foobar = 2 $foobar == 1 ? 2 : 1 = fail $foobar == 2 ? 1 : 2 = ok $foobar = 1 $f__bar == 1 ? 2 : 1 = fail $perfection == 2 ? 1 : 2 = epic fail $foobar = 1 SEE ALSO
apc_dec(3), apc_store(3). PHP Documentation Group APC_CAS(3)
All times are GMT -4. The time now is 09:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy