bug-bash
[Top][All Lists]
Advanced

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

commands following asynchronous list are executed twice


From: Oğuz
Subject: commands following asynchronous list are executed twice
Date: Thu, 2 Apr 2020 15:09:08 +0300

While reading commands from stdin, if job controls are enabled,
commands following an asynchronous list in `{ cmd; } &` fashion are
executed twice. See below extract:

$ bash -m <<\EOD
{ sleep 1; } &
wait
echo $BASHPID
EOD
10615
10615

When job controls are disabled, or an external utility is called in
the same line this behavior disappears. E.g.:

$ bash -m <<\EOD
{ sleep 1; } & x
wait
echo $BASHPID
EOD
./bash: line 1: x: command not found
10618

This is reproducible on 4.4.20(1)-release, 5.0.11(1)-release and 5.0.16(1)-maint

-- 
Oğuz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]