hush: rework "wait %jobspec" to work in non-interactive shells too

Also add tests. wait5.tests so far fails (but works for ash and dash).

function                                             old     new   delta
builtin_wait                                         305     283     -22

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2016-11-08 00:59:29 +01:00
parent 26ad94bedc
commit 02affb4afd
9 changed files with 28 additions and 13 deletions

View File

@ -0,0 +1 @@
Three:3

View File

@ -0,0 +1,2 @@
sleep 1 | (sleep 1;exit 3) & wait %1
echo Three:$?

View File

@ -0,0 +1,2 @@
Zero:0
Three:3

View File

@ -0,0 +1,5 @@
sleep 0 | (sleep 0;exit 3) &
sleep 1
echo Zero:$?
wait %1
echo Three:$?