Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: =?UTF-8?B?T8SfdXo=?= Newsgroups: gnu.bash.bug Subject: commands following asynchronous list are executed twice Date: Thu, 2 Apr 2020 15:09:08 +0300 Lines: 29 Approved: bug-bash@gnu.org Message-ID: References: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1585829371 22942 209.51.188.17 (2 Apr 2020 12:09:31 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=Rnh0hn/WPT1A3gqLWxxsxeDDeSBgcO8FLH+p54NrpbQ=; b=gJ3ImpGmjoTHH24ztzviOjkHtihYixs4F/BrbvtvjwPNF/Vtkq7EL4dySeWmI/D6Fy T3T9iBLhBPXOLzSiiPStqMDdxwpEnOUQN9QfzfRwHUyxh5O9NOlxdg0whdy9xNGPl/sA OocXyhDqYDTYrFNey5Kr7vuSNjUNVwYTeZzFAdf75G8Bry+fwLgic47SgVtP0h02ML9P +NOrR24bEivdrnTs4gm1T0WQRgx88YH82HOGW0GfW3n5TiNSy01VJZyTco/xy6lZdZu8 J9rLR6Ca51d+dJWUWeeMaS+fpS8hxN9dOrsOfDQfTLWAOxgE0iP24NPpIfg7AlIRkUVd vbgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=Rnh0hn/WPT1A3gqLWxxsxeDDeSBgcO8FLH+p54NrpbQ=; b=mw7QFvxAX+CJnTtWgrvVzKpVfCh3LzJUgQGdphibUjWOoGK9Pr7xEGPCm7nll5063j n6FSJIppei5lzmeQhnZrj97iEfVqE8Wf1Tmrwmj6/v5YctfiCdv8nN9Vhaqw2TpnQ1eq OBP9VMv0QPYJjO0a/C45kT00KCJRAeMg7Fh0Er63rvACxnqE5j3IYh/FjUENuQypdpJi UesNUuE9PRLzJ3azzBp32UPxXbwCYx9ONn8le5bOk4t0AP6vtXNK2K43a0mORZZ1zdM6 jLsY493dgvpHC0D5IoOeiSOQzO7U52hJg/0lbfwgDG+kRRJXGn1fvkJVrrrA/SRAqt4l 1BRw== X-Gm-Message-State: AGi0PuZ6JydraK/psLRnJGkfdb87va8BF4mcqGa7P7GQJG1BPLszCMiF tetsbt1fpDvdscLkvjk2Llewhy25WvcOGHLbOpwgiwoWyJg= X-Google-Smtp-Source: APiQypKNKB+07YyC44WDJdN9OqIiNEqQ8Rxz+E8I1TlFVaRQmfgx2N6yqt0KHffXfUKmhweaUZplMzKjcOYZ33gxyu8= X-Received: by 2002:a67:f993:: with SMTP id b19mr1789087vsq.117.1585829360228; Thu, 02 Apr 2020 05:09:20 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::e2e X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: Xref: csiph.com gnu.bash.bug:16076 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 --=20 O=C4=9Fuz