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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22389 invoked from network); 13 Feb 2023 09:44:18 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 13 Feb 2023 09:44:18 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1676281458; b=nrzgNpBQIMI0N7FEwEYKj74MogNGAZOCcWhN6BJzmFik44dWeM841ROC3+L1op31H/0OhAodU6 feaO+eVgagRd1nV/02WA28xmdB/sQxCicVSDiJeHDr56PxKldaxkjcyJphQ+gePTW2CfBUaK5r t5ePSy9fV2si3W/qQyEnOiOPNiWkPtg0Z+U6VdjUoI3WtUu0d8Vd7YdsSEE5VwoKmvl0BQzndv H2QfdXynCwov2lXMFHzwEEOv5k7eHK7MKpjzPTXJ+PV6IIEBW0wdlJD55KCRC0zBvLhH4+gJR5 JObYiq44kNm5vFMtChE+6G87EyjB1A+aL82ITyuakWrWLA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f171.google.com) smtp.remote-ip=209.85.208.171; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1676281458; bh=nJEY3DuoFHth/eFXrmPLHuE3fqxQ+l9mTrgU2N+QT9E=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=g7kqWTpsBZHL+mhg0zNhGc5pZYrtc2Eq7i/iBH/ixmj0uEYEhuL8oAeIvTRpfcskIfIQY0fsbp 7cS0pG7tsoyGMigqCv125OVmkfuUh+7vDI9I1Qgr9hXU6Oz/u4roGCwdqOFtcahhJVcViljeF/ 7dVaDat2Sk0MkM9JnPBlmaTitf9/Yxa1Ye5A8IwB7vElFVIkZPRMZZvsh17ukUNIrtN5gZhySP +ZJMxE6A95a/Uka6n6MWA7s0YnfRFpgxVwoqUmDPuGNnPGXdpPbYemDpX130ay9/CCwgiW40yy hiMl1Tze3qSqGoG4PmoxdOiXpw5paj8srrGSaVjH/UwWTg==; 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:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=JIvC05osPg5VfhlFNxConVxVY4W32cwXHf9Pnk54cic=; b=rhpRLg3H84TCwPQ5XqNqGT+vxC vWp8GT9Ij/YXKqVyDVNXQfQ0E5OQgH/cQW5bahOVGit9DiRTrC+prLFXBLHe/+rpdZ8Gkks8MLKpj b+20qeh9xrzWdxHAurainBldtQcrqxjidgInmwATzB/7u7WwmVnc6w6iyAwnCeTt2xKsLTPL9/s7z Rgc6ojYbx7IMHfhhziFMPWYCcfHyXmnJqS6gQ2fk8IM6OJDDTor87nQQIEL6CGfNJvWJlYwx7kivP fL9BDBbu2zLC3ntczb6ry7I36d7jMkaqi5mQlmjRZ/0pa2nW2J2ez+NltCZhTVK4w6/0kxA9AFVZv PgorUr0Q==; Received: by zero.zsh.org with local id 1pRVNi-0006sG-5d; Mon, 13 Feb 2023 09:44:18 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f171.google.com) smtp.remote-ip=209.85.208.171; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f171.google.com ([209.85.208.171]:35389) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pRVN5-00069t-9a; Mon, 13 Feb 2023 09:43:39 +0000 Received: by mail-lj1-f171.google.com with SMTP id h4so13974308lja.2 for ; Mon, 13 Feb 2023 01:43:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=JIvC05osPg5VfhlFNxConVxVY4W32cwXHf9Pnk54cic=; b=cNYW7TK0qK7ods77ZGK1oCFb3kJxjV1P52E2UwzpJOfrgXWpo48zgeBWThxaZ1L80w HoXgwnDvbhtAsUpOVKszfsY1pKN77uQUsgRQsnkAEBzq/RTe+1OJDOrLV6ZEkUaboOjr OPXNoyBfm9j0L0ouiMGPX7xKHYm+WLFJBA6FvK1YUGFADjXzVTNinrPlnnaFa7skmJff EllQEY6DPFO8KqZyWA49u16pleYGPqmymNeud28wunKIc3h7DyU8CW/4izcMr0EaNaUW V52GYqv/uP1qe/ix+z1X3QjrUjxiAk93r29C4RM8OxnmzA4yKiWrE/zNzIPmm/2qEbHA UH9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=JIvC05osPg5VfhlFNxConVxVY4W32cwXHf9Pnk54cic=; b=qfekAyM2hw8nMAspZJWXva/nn6Qo1F3fgaHainzuuSrtMq7PCxiS+/fIcSfTNzWeXr 2hsroiiIepq0qoSGK8Cle/5RME3kUwSLAnGbR6RfHme4T1EnhgKVTiQQpAgiM6ZJDd4o tK8YeuzKWOwifRNhuxKwJw7Z3gszmMxJ1O4dLaxF2iNz745SLiCOn9BsF6r5FEBTQnTk O3lP5p5Opok0e42rVEiwTM6nud3Kgy3vYrQAj1KopBR/1rah75WfiUVqn9iuEpKsBhHR nKUQWV9FfkzzHFQn/a2dUvhvLhRuUzaoXnXsizismeLLqwP17OPz8Nl1DF0HoqEOojVw nihw== X-Gm-Message-State: AO0yUKVcZJEJ0hfSDtjlfTkltzFXioPtMIeoSNrruc78JQDn6vzNhiT2 EU9OSx4ptEmrcFhPVw464bI+hwrhGKLaZnUdOJQ= X-Google-Smtp-Source: AK7set8KqGet4FKfw+xz6/9UaIsne/KIlrBsmIoj/TieycYDAHvGHoBaLy9oyxDahNFDfBIu1o18vJp6OzgvWlfaSjo= X-Received: by 2002:a2e:720d:0:b0:293:4c5b:b4a6 with SMTP id n13-20020a2e720d000000b002934c5bb4a6mr688997ljc.142.1676281418540; Mon, 13 Feb 2023 01:43:38 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Roman Perepelitsa Date: Mon, 13 Feb 2023 10:43:26 +0100 Message-ID: Subject: Re: Read/write multiple histories from non-interactive shell To: OG Code Poet Cc: zsh-users@zsh.org Content-Type: text/plain; charset="UTF-8" X-Seq: 28939 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Mon, Feb 13, 2023 at 9:57 AM OG Code Poet wrote: > > My larger script misbehaves and exits with 0 before it could > complete if I replace #!/usr/bin/env zsh with #!/usr/bin/env -S zsh > -fi or #!/usr/bin/env -S zsh -i. You might want to try to figure out why. > Is there a restriction on starting any existing functional zsh > program with -fi? Put another way, are all non-interactive shell > scripts guaranteed to function when shebang is changed to > #!/usr/bin/env -S zsh -fi?? If you put something like this in a script, it won't work the same way in interactive shell: [[ -o interactive ]] && exit In general, if your script needs interactive features, it makes perfect sense to use an interactive shell as the interpreter. Roman.