Re: job control (Re: dash race)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux