From: Alexey Gladkov <gladkov.alexey@gmail.com>
Cc: dash list <dash@vger.kernel.org>
Subject: Re: job control (Re: dash race)
Date: Sun, 27 Apr 2008 15:23:57 +0400 [thread overview]
Message-ID: <4814624D.6010108@gmail.com> (raw)
In-Reply-To: <20080425161721.GM24008@flower.upol.cz>
Oleg Verych wrote:
> What script tries to do?
This script forking child process and send to parent signals. If you
are confused with functions it is possible to replace them by other
script (see below).
> which is kind of strage. Messing with functions especially in background
> isn't a good idea. I wonder what is semantics of functions WRT traps,
> forks, signals, etc..
Maybe this is not good idea, but shell specification allow this.
Another example:
<============ parent.sh =================
#!/bin/dash
trap "echo TRAP" USR1
./child.sh 3 $$ &
./child.sh 2 $$ &
until { echo "###"; wait; } do
echo "*** $?"
done
echo "parent end"
========================================>
<============ child.sh =================
#!/bin/ash
echo ">>> STUB $1"
sleep $1
echo "<<< STUB $1"
kill -USR1 $2
========================================>
This example have same problem. The problem not in functions that
executed in background. The problem in the 'wait' command.
> Also, `ps` && `kill` is better implementation of job control. dash's
> interactivity isn't a good one, so what reason is behind shell's job
> control after all?
I don't understand this.
--
Rgrds, legion
next prev parent reply other threads:[~2008-04-27 11:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-25 12:39 dash race Alexey Gladkov
2008-04-25 13:45 ` Oleg Verych
2008-04-25 14:37 ` Alexey Gladkov
2008-04-25 16:17 ` job control (Re: dash race) Oleg Verych
2008-04-27 11:23 ` Alexey Gladkov [this message]
2008-04-27 11:49 ` Oleg Verych
2008-04-27 19:18 ` Alexey Gladkov
2008-04-29 12:20 ` Herbert Xu
2008-04-29 14:04 ` Herbert Xu
2008-04-29 15:51 ` Oleg Verych
2009-02-22 10:19 ` Herbert Xu
2008-04-27 20:35 ` Oleg Verych
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4814624D.6010108@gmail.com \
--to=gladkov.alexey@gmail.com \
--cc=dash@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox