PDA

View Full Version : How to send the message box generated to background



bkpsusmitaa
August 22nd, 2013, 06:43 PM
We are aware that an "&" at the end of each command executes it in background.
How can I send the message box generated from the following code to the background:

title=$(gettext ‘SCANNING DEVICE’)
text=$(eval_gettext ‘Looking for PPPoE Access Concentrator on $iface…’) &
if test -n “$mmm” ; then
mmode=$(gettext ‘(multi-modem mode)’)
fi

Bucky Ball
August 22nd, 2013, 07:34 PM
Hi. Please use [code] tags around code. Makes it easier to read. Thanks. ;)

ofnuts
August 22nd, 2013, 09:56 PM
This code (the 5 lines posted) doesn't generate a message box?

bkpsusmitaa
August 23rd, 2013, 06:52 PM
The code is from pppoeconf script file. I have modified the file to suit a particular purpose of mine. Everything works fine, but can't send the message boxes to the background. The popping up of the boxes are so irritating!

ofnuts
August 24th, 2013, 01:55 PM
That doesn't answer my question. You post 6 lines, none of them producing a message box so it's hard to tell what to change.

OTOH if you don't want the messages, replace the calls (zenity?) by plain "echo" or else... The "background" in which a line command runs when suffixed by "&" isn't the '"background" of your desktop anyway... These are two quite unrelated concepts that just happen to share the same name. Just adding "&"s will create dialogs on your desktop foreground controlled by process in your execution background.

bkpsusmitaa
August 31st, 2013, 02:41 PM
My apologies for delayed response...

That doesn't answer my question. You post 6 lines, none of them producing a message box so it's hard to tell what to change.
Actually, the question mark you put at the end of your post confused me. I will attach the modified pppoeconf script file. I have removed the execution permissions and renamed it with .txt extension.


OTOH if you don't want the messages, replace the calls (zenity?) by plain "echo" or else... The "background" in which a line command runs when suffixed by "&" isn't the '"background" of your desktop anyway... These are two quite unrelated concepts that just happen to share the same name. Just adding "&"s will create dialogs on your desktop foreground controlled by process in your execution background.

In the context of the six lines - how do I modify them?

245864

ofnuts
August 31st, 2013, 09:21 PM
The only way you can modify these lines to prevent a message box is to replace them by "exit" to kill the script, because the message box isn't produced there. What makes these boxes appear is the various calls to "$DIALOG" (for instance in line 195) whihc is substituted by "whiptail" (see line #13). These are the calls you want to remove or replace by "echo".

bkpsusmitaa
September 1st, 2013, 02:14 AM
... replace them by "exit" to kill the script, ... That is not a reasonable solution ;) because I need the script to run iteratively ...
because the message box isn't produced there. What makes these boxes appear is the various calls to "$DIALOG" (for instance in line 195) whihc is substituted by "whiptail" (see line #13). These are the calls you want to remove or replace by "echo". Okay! Thank you. But how did you arrive at the conclusion?! Could you give me a hint or two? that is, why not the lines I posted but the $DIALOG? The issue provides me with a great opportunity to learn. And at present I believe I am in contact with a highly experienced mind! So it would be foolish of me to let go of this opportunity. I will try the necessary modifications and get back.

ofnuts
September 1st, 2013, 02:22 PM
But how did you arrive at the conclusion?! Could you give me a hint or two? that is, why not the lines I posted but the $DIALOG?

"man gettext" doesn't menton any window... so I return the question. how did you reach the conclusion that the windows were created by these commands?

bkpsusmitaa
September 1st, 2013, 06:50 PM
"man gettext" doesn't menton any window... so I return the question. how did you reach the conclusion that the windows were created by these commands? Because the message boxes showed precisely those messages like SCANNING DEVICE, Looking for PPPoE Access Concentrator on... and multi-modem mode... So I guessed... turns out they were wrong guesses!

ofnuts
September 2nd, 2013, 10:06 AM
There is a difference between creating the text and displaying it..

bkpsusmitaa
September 2nd, 2013, 04:53 PM
There is a difference between creating the text and displaying it..
True! It appears that I did not have the capability to pinpoint the function $DISPLAY. Maybe I will improve with experience.
Now the main issue:
How to send any popups to the background?