From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24725 invoked from network); 3 Oct 2023 00:48:37 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 3 Oct 2023 00:48:37 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1696294117; b=mxSOmwwwQMVR57wUZEn61S/rMTijNMxzlRfBZjXJSm+BnV1jrJDH8xtfOPt0TxVSCtPS+JVir9 eECTBLCG9C/JivVMfggE1cuxrLwxZ7yB3nUbw2byYemx6UKaHFDI79QTWwsF5DSHTd3e8qt1vK Dcp6MEcOCuaJLw78RZoigQ4ROjaitH6m2zgQKm75FyKv6iKPnhNlQDddSXmRCAjYKfsIm9nhBv Sh4Vd36sD5xJPEwZeokOgnlAH2BOPB4lS8frapkarXJazoPsP+tJ4NEbwCyc8WzCyAY8Axwuxz ALe5MZhpVxZwL/4UOn8E15cFztm1uJyzcXVMY+IFGiUqvw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f47.google.com) smtp.remote-ip=209.85.218.47; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1696294117; bh=AsczVsy5TIfoGsc3C6vMrfJqIvpFUumqni2nscPTSl0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=RHlaFyL14soseO4cziAt44X7gEij8kFbaobFwA1PfeJLV7fck/2Q0S2alFq7e5KrKl12K5fI6i AOU1tyWQTfmQTy8oi0pbLQIs+afWsfbklElHjIEtWu40UlQ2/shFc5Jz/huIwOu1AFHEPFd/7p nnVGB2PLsG3YKm+cv7ovVr+wXKaBsthAFEVZaIU+QXtHJmfsZLuWwdY1J049IsQC5cIKper3Uz KYbJbhkMmmr0IWzBe1/11ZilFBtksyHhwMfor83o2jn3oMLPwCKJMVaOUzDjGgfyCT+KQsVgSO xByWC9e/h0SQAq0TgaSOLz3Vm4l9cksLBUuJ6CbEx4FASw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=i2kMdemRWTOISC8lkfbx3MwzxpC9fo3ciVfbCkop1RY=; b=Fdk/hrHoQAjJb5FcJjLpEQ5xhW /HBA3tyBUteKOhvlsCYFI1TVmBDD6NOPabiCSBHCh6fcndstl+68gAP6Z+AtGtktHoJ5y4fBOVOmA 3n5kQIUbLDnwQNQnlbPsFrGJScuqCzOeuJ/PrnW0j3WmDAxS7Iu9Lwx4JzojH2zNXc69Ic0UENOjY JdfHJpfMh2X9KJmYMzaIfq4CfEchMmkcwQZ+n4hI0Nzj3rYLm9xrLEP4HDrL8incp9PhCBf1Tmx8H me84HERW+PNiQ5r8mBnFScVepU2D+qUJQs5U6eq0a9mVZINilja4Icle/T92XNsYiqogG35KAwkja 57qxYlgQ==; Received: by zero.zsh.org with local id 1qnTaX-000EEP-At; Tue, 03 Oct 2023 00:48:37 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f47.google.com) smtp.remote-ip=209.85.218.47; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f47.google.com ([209.85.218.47]:62959) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qnTaE-000DxB-ML; Tue, 03 Oct 2023 00:48:19 +0000 Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-9b275afb6abso826699866b.1 for ; Mon, 02 Oct 2023 17:48:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1696294098; x=1696898898; darn=zsh.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=i2kMdemRWTOISC8lkfbx3MwzxpC9fo3ciVfbCkop1RY=; b=lJk7WRK7MSIkWCcAxacmE9ua43s5eYNqk6yG1/9mh0Noslp0rQsTrDr0ITTWBrlC97 pYEDmSvHBXcItN9LuN263CpYXaZbJSMKIkA0ecEAZvrrs4zZguVUHJQfNhIubKQsA6Lv w4W1A2FZBazqmUOgdB7Aoq6ZB9Q9jUCu44vMsUICGEpZBMC01TtSvQXYIobqcORVWDnn D5aJYoFBeFKk07t28T4EvLRBXgBlhTgDhcoa25l3dIOx6aBjDgVbblEdQRsERmdENY4i RFLBV69iVrB/6oByGXFB7vOd29YILK3O7icZFNCJiL6kRWhJojTOuRUXfqQ0kLEsttun NwGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696294098; x=1696898898; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=i2kMdemRWTOISC8lkfbx3MwzxpC9fo3ciVfbCkop1RY=; b=sHW+VpWBhubfMafQn0L7HpgXpDVDE7hoI/1jK4WW8IgncIzqXUr6tRGU8XU8oUH9/u 58pKEF++yiqJ9uDDCQoJfVSo7uMhMrGaeBAm7ac3qmT21hZEJaPFCRxaXtBFIdXJOMam CaxibA4rmXi0V27TkweoPoqeBnvsZgWVWx8KN/U53c6B8/Suh8aUG8KIoYXzni0Kwceu fArtz1iXtqnEu6Cv1+G3gPIim99GQjnb9FxAo6vSVbtLfazgpBUf9jJylZC21cEXaVGA INIxBPtDYn0FX54D8rXaV7aqu0neRnWM+klH1EbNaEgG2RpPzxpekbcY43jP2b2PK99l LXig== X-Gm-Message-State: AOJu0YxIbua8A1inEhePWM5Kx4Z2vJx87AG9jz/afRqay69q5Il70tgJ 4BPE9CacIVcepJmkVJtu9qQR2SxG6CAJAbxGzXUO4VtEeafmyBsm80A= X-Google-Smtp-Source: AGHT+IEAJCqbbIhIUE1mMlrfwJljo/sPYGRvZ8el01YnnRImZfMsRWyxhGdRwmbRPYobD/beFyuQunUXhxCCqIOAs78= X-Received: by 2002:a17:906:30d3:b0:9a2:1e14:86b9 with SMTP id b19-20020a17090630d300b009a21e1486b9mr1075787ejb.0.1696294098165; Mon, 02 Oct 2023 17:48:18 -0700 (PDT) MIME-Version: 1.0 From: Bart Schaefer Date: Mon, 2 Oct 2023 17:48:07 -0700 Message-ID: Subject: Expected behavior of background jobs in ${ ... } To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 52199 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: Consider: echo ${ { sleep 10; echo foo; } & { sleep 5; echo bar; } & echo done; } The only version of ksh I can conveniently test, discards the output of the background jobs and substitutes only "done". This is in conflict with $( ... ) which delays for 10 seconds and then substitutes "done bar foo". It is conceivably possible to keep track of jobs started during the ${ ... } substitution and force the shell to wait for them, but then there's this case: echo ${ { echo foo; } & { echo bar; } & echo done; } Here ksh also discards the output of the background jobs and substitutes only "done", but that may be an order of operations thing. The current zsh implementation substitutes foo bar done but that's likely nondeterministic. Is this worth worrying about?