[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
no input after fg
From: |
Martin Drohmann |
Subject: |
no input after fg |
Date: |
Fri, 13 Jul 2001 12:16:32 +0200 |
There seems to be a problem with job control under bash, as the
following script only worked correctly when I sourced it. The actual
purpose of this scripts is that the user can interrupt this sleep job
by pressing the OK-Button of the messagebox genereated by
dialog. However, when the sleep job finishes, the messagebox is
supposed to be killed.
set -m
function kill_sleep() {
echo "killing sleep..."
kill "%{ sleep"
}
dialog --msgbox "\n.When you press the OK-Button the sleep job
should be terminated\n" 20 50 &
DIALOG_PID=$!
# sleep job
{ sleep 9; kill $DIALOG_PID; } &
fg %dialog && kill_sleep
for those who don't know 'dialog': dialog --msgbox "..." 20 50 creates a
dialog with an OK-Button with 20 lines and 50 columns. It will be
stopped when it tries to write to tty.
If I source this script everything works fine, but if I execute it as
a bash script, dialog won't react to my input and seems to be freezed.
What is the problem?
Martin
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- no input after fg,
Martin Drohmann <=