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,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17691 invoked from network); 19 Jun 2023 00:21:37 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 19 Jun 2023 00:21:37 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1687134097; b=TqUC+Au2MyTyQmWZRUz4VNtN4gq5FL6jNBWEz398tO1QQBnOtK6KRdhf3YJXZOtwODlXNpA4kZ RUGNzWThzF4WvsDiEm3+4Gbu9glLPhiFYVXH69EIDiizpAsNABrkmLj/YHjD6yui4GRqi0DWed mO1R6gyikuHrCqDZvVRLcYEAgZTYNjdvv4VAfs1piDFcTNS56NQN9MNjXstPeSSlNzGerwhKR+ biMWTiFSWfx3VjNGY0heYtRAI35Tyl9bf+MMdcJNTEXKWB/LeCWfG0mgXsmGMPqBXy9xoo3lHH q0Eb4dBQHPXvTy+fCYOCs9aqLmpZntUkcSNQFY/xB5pDdw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f44.google.com) smtp.remote-ip=209.85.208.44; dkim=pass header.d=brasslantern-com.20221208.gappssmtp.com header.s=20221208 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=1687134097; bh=SS3xTjC6lEqzVxAIA34ZbTODlwaazuFZWMe7YgtH0Ao=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=DgzkY3nDbNGfEiNcgekj8ICRieafRCj35C1vkbqM/Ge/OuqdCmLj2iVnPe49GTq27jdlcHbO02 Gvv9suRrXzEZT3q7zWpqA2R+c2dmGVnD2qeb1MtT4h3nZ1v30bWuoy1dcLC5t8+2zolVTX1hGW BwAG9OEXk0RxDajSulDBd0kywN/LLaxcBcUYXhIm4pj4l3P2FavHXrtnceJeCHPyZKUG29zKYb X/mg0dai+AHLeFmSEb8sPNZOlKBBF7HYFIHgHfc9WdQ32p8Wa7Hdkh4m06fzXJ4KiC8JIti2cK 2lHfow3L5XmPVDEX6uq8mfzXK9az9Joj1sCLuvuVLewppw==; 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-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=NbUljSZh9oSm16/f7pXva0EBvgu/gqame+aaZRITgNM=; b=H3maDnJKhIj4v0mYHjHzuTCqnT 0z+ABUxMcUWpoVNcTOINh+AjAtDWltTGYsgNcbg73FSySI/vpt6onEwxdK197YM6qkNZvWJ0/Gc52 bp4iYdVi4UlWAeEo8eaNEcfUny+RxUeox8tosIwUAdYAiooMRVNkEQgSICmsEhPI93AUNVR9FnG9E 7cwuQevzrmZHbu9fwIGIEV8/9K5VeOyFKlCyRXhzOyqlv96Io4FlYeTpmSzTr8BNxMGVB3NfCMSf3 pUDWOJSyNICl+3lrY+9muaCrCnMpNeUB8YgX6qhIH2qFUBHTUaRgS/Qjv/DKikkwrFcsIe8sL135R egSxe+pw==; Received: by zero.zsh.org with local id 1qB2eF-000I2T-Ol; Mon, 19 Jun 2023 00:21:35 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f44.google.com) smtp.remote-ip=209.85.208.44; dkim=pass header.d=brasslantern-com.20221208.gappssmtp.com header.s=20221208 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f44.google.com ([209.85.208.44]:45214) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1qB2dx-000Hkd-90; Mon, 19 Jun 2023 00:21:20 +0000 Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5195c85fbb2so3703695a12.2 for ; Sun, 18 Jun 2023 17:21:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20221208.gappssmtp.com; s=20221208; t=1687134076; x=1689726076; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=NbUljSZh9oSm16/f7pXva0EBvgu/gqame+aaZRITgNM=; b=J+dnDqx63bSFWHb38RBjjYHCaxt3mDg5oxo8/zVJX9yzLwuy2dKiqNaotlVGjtb/6i 4XwpVatklEzJWtYrTsC+EXGmM33a9WKAL3Ym56OhdDLNbHeZ2w6AN6ccmVzLhLgwtd4X fqR/3TQtcuwDtgJHPEPYXIV3tN0uvg/bcA6j5xqQygvx+sFASEsAsIkIvN3qjFGzITzR 8ODSkjtNcbP5rso/e5jloKeAGq4TerDr00BcPRqizOV2AaAvcSfxy499fKY5rS9r83sD FV6FoOnnkgmWRI4CqQKmEB2NGYdIvRWnPtoOnoXam4j0yFV4Kw1Sf/PA2Xz6Og5jZrE1 i7hQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687134076; x=1689726076; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NbUljSZh9oSm16/f7pXva0EBvgu/gqame+aaZRITgNM=; b=S/q6vL17ssW8UqRboX/bFNDWZRDuamAa+bhbWtgvPPfqrdJUqYQXrCoePAiE8p3iG2 YpoXYYDcItGkB+NAnRIoLc0aVr6MHBorNM6tjLTC8Xg4VgxKggFsV0+H72L1K7LxIrid kGaTI6silkFXTfr+bPaeJ/rmjxqVCl18cUCUvpWwQdCS3m/af7JngmP/65IvmMYeC3ct Xo7P0b2O7IEJJFSuXvPEPosNERHzMcrWESi4wHFVpJ96ysJ6XuDQDDmN5nvHJqDNuogm Er4qcne9l6PMpj7GGyxPbLcOIDa8PThrhfy8SgT80h2v4WH3D0WcDzqn/QthO4ZR27+m JhhA== X-Gm-Message-State: AC+VfDykBz1Y1eHi0z4jM5Ngyhg+ijFePZ4zZ5aa/02opOyvzIHRyYRg ClQmyuV+bxZhp2Af6kbRBikYm8qCsLFVTQvFlRIg8A== X-Google-Smtp-Source: ACHHUZ7uoyKOlP6X1K0arbq6yG98LYcngrIDxhMVh5XcboSeAXAA7hlDt1nvj5+R9x6YZEs99VTnUqcAeRVks/bU8nQ= X-Received: by 2002:a17:907:7204:b0:94f:5847:8ac with SMTP id dr4-20020a170907720400b0094f584708acmr8659219ejc.51.1687134076356; Sun, 18 Jun 2023 17:21:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Sun, 18 Jun 2023 17:21:05 -0700 Message-ID: Subject: Re: Random file creation in zsh shell. To: Roman Perepelitsa Cc: LitHack , zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 51875 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: On Fri, Jun 16, 2023 at 11:36=E2=80=AFPM Roman Perepelitsa wrote: > > On Sat, Jun 17, 2023 at 4:04=E2=80=AFAM LitHack wrot= e: > > > > There is a way to create a random file in zsh shell by which we could h= ide any of our data in it. > > Is it expected for `=3Dtrue < =3D()` to leave a temporary file behind? When an =3D(...) temp file is created, the parent shell assigns removal to the child job, which is supposed to happen when the job exits. In the case of a shell function or builtin, this works as expected. In the case of an external command or a subshell that performs a "tail call optimization" like your "( exec true )" example, the thread that's meant to remove the temp file is replaced by a new process and the exit-handler that would remove the file is lost. I've spent quite a while on and off in the past prodding at the code in exec.c to try to convince it that when there is a temp file present it should skip the execve() and instead fork()/wait() to be able to remove the file at the end, but have never got it to work without breaking something else.