From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from zero.zsh.org (zero.zsh.org [IPv6:2a02:898:31:0:48:4558:7a:7368]) by inbox.vuxu.org (Postfix) with ESMTP id D659723D2B for ; Mon, 3 Jun 2024 16:55:21 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1717426521; b=Gf5YOei4m0NKpzHQf++huPp92oklsrul8Cn5QUecm6QU2hd5AAqj1xBS6INeMGF3MzJmfykwNq JFFFgnYzk+nyZKExOEZ6Mu0VDMntTt9el2rGEyzp0kQVXwaeMZRyRrS/7XpcTmyy5AFTD8Zw/2 R6XOddgT0HtkjbGXpJrw5LEmQykPUQjzD+vRQDopLyR2+mnCjgJlfLLIzlrOedULylYkj8M+06 /IYQ4fmbNk98eiNvm4ISY1vgjyFqLSszxt+eN7gB9+2tXN6gmGAh74h6VIwvKuPMzhCgHRyGUM ITxwQQTzjTQ/D6qct+ZinmiCGUi1qh8pMzGrMFL4z4b/hQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lj1-f176.google.com) smtp.remote-ip=209.85.208.176; dkim=pass header.d=gmail.com header.s=20230601 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=1717426521; bh=KkX1jQ7D+hgEqpxXUvtizOiKqOQ2hWpTX3/M/fnCV/Q=; 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=B20CCJ6cG/fQ0uTZrqJTdAJg28Xum4N6WlClNkLNa/QoJPsfkw2erkBjSkspMB6KtFiLdwcE+4 JAtYNEy6HH9MotxWnEo/v+Nkpcj04WHW549V1kuyQFA4zkNWXybicWeUF18wC5LmUVAIXwfHIw VJAWTQR//odaNYbpVuIJHb9hGc1lvoYmAHC6r4nqlzXN9rIsYjKEGWqDjgZOzdVUYGXiEesqjv T/irfNtt3LFgJgtCtcO4rpRwVXccVnMJpAI1ZtnMzqFNZVg3cNfSva9OdEgortNpvbZGTofgvO BCfKpyWFBLk3F+YtJRMGbuQeygyfsuzk+I6vMsCFkPfo/A==; 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=t7bd1KttWD6GsibJ0piD9RlpSWOwqs+ZsFPP3R7ZV10=; b=C/mqrT6sUH/WMPyP3l8RNsLKvh MKuXcpwxUngXEuutFjsrUfZwkg6X1EdlJsKfStej5fyBfAsGFXmUogOujdChpPtjp/DFY/7Cbf8xs C8esxAecks6I4e0IgsrAkm9h7D5fDFKosBgD6GdCoBWus6TGqpOLssAuGpDRhervtLz2F2JJK90r1 iis8GaHFFnPhx3WRILiYY9X8alCJgqMWX4/E7ZeWE2TGipLXeoNC35f/TbXvZA6q8lTGIRsVXz6GN 8U4CneonltZvV8sq1t2ogSWW0AmPu3WpRLn1gCkdR5hsnSXgxh85vmN09uP7Q8yrcYW7aBKfrNnzr p9BThnpw==; Received: by zero.zsh.org with local id 1sE95l-0003uK-I6; Mon, 03 Jun 2024 14:55:21 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lj1-f176.google.com) smtp.remote-ip=209.85.208.176; dkim=pass header.d=gmail.com header.s=20230601 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lj1-f176.google.com ([209.85.208.176]:42477) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1sE94y-0003Aa-5n; Mon, 03 Jun 2024 14:54:33 +0000 Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2ea8fff1486so33499821fa.1 for ; Mon, 03 Jun 2024 07:54:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717426471; x=1718031271; darn=zsh.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=t7bd1KttWD6GsibJ0piD9RlpSWOwqs+ZsFPP3R7ZV10=; b=hargLlqtMEuEBceNFjYMuHic8aSdxKhfys/oh5qPpNcRvLTP9xwV4t292LQRc1g3CC PbQ7v31Jg/By+jr3ocGQzBDKNl43A7RnPgUEx1t/u6hpmy9tpQ9HwhH+ztXQkaNWXkfg 6SzHxOM4OZRCaQzJmkVScIZOdLPO3cti3YbdaqHI+TIWySP4kG8xRoawhA7AA28kfuY2 OikwYpcOGseI1MuzRzNIDP3t9kpP8SqUBj2p417ptA+ZmUBvgfdcdWeiiiuGjIkdFQC1 8CqPSwIHPJAso+Pfvsp7qvjo6+oXIOQt/xokMHNjvphVhNw+eCQ6MuL5hy44XdizECsm hriQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717426471; x=1718031271; 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=t7bd1KttWD6GsibJ0piD9RlpSWOwqs+ZsFPP3R7ZV10=; b=rXVDuk+9Ew/aQSDvPv5tzS0S9vEjTF/+VF76zN9p1kqQ3XeP0njG062spq/M8BDaU8 bNYI8GQN6WxgMIexjm3Lolv2n/BWujR73DEd5uDBRUfXQid2CCvUWCRGarDChf2f84Oz ab017R/xrgFGbEDddslTbJHqa9Tc+jgk3AfoIqAoBJ4wGxDi87hoIJFWIkVd4tgq3LO3 EUO1GStQhFpg+WVsNIXv+IZ6cvmtmHwu8PBRlKfM13cvdbpTx0UQqq8f6fuDaTrsIGx3 3c5O+9maVIcfA/fJcWvcN2HzuUdk2sa3H6QFXuvnacEpa0IamyU7YlHZFOEXyo/vWCA6 YVgg== X-Gm-Message-State: AOJu0YwIBj1dN//6xHk0x89TBJVdOVHLN12SJyr67nj+3AJ68qGR6iP2 xd88nTr1YdJutPd1lxfYoqIRpr/GTCgU3VOn9k3NReu2Ly6AzzIvouv7gZh9pqwekztpQja8p6O +qlcNgPsynatCoBcBqeZ7OiaQCImxjHA/ X-Google-Smtp-Source: AGHT+IHXV/wNHO+YxBu3ph9H1TjZlqEApcNtaTYusAsztKa8vuy46LtgMLAS+WQ+Bws3M8g2gNJhjrP7uwqrFwMRGEU= X-Received: by 2002:a05:651c:4c6:b0:2ea:ab3b:fd89 with SMTP id 38308e7fff4ca-2eaab3c0232mr12775851fa.10.1717426471379; Mon, 03 Jun 2024 07:54:31 -0700 (PDT) MIME-Version: 1.0 References: <2bb9cec5-1293-4103-a73c-fd2a190cb65d@eastlink.ca> In-Reply-To: From: "Mark J. Reed" Date: Mon, 3 Jun 2024 10:54:19 -0400 Message-ID: Subject: Re: exec To: Ray Andrews Cc: zsh-users@zsh.org Content-Type: multipart/alternative; boundary="000000000000c12b3b0619fd82f5" X-Seq: 29983 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: --000000000000c12b3b0619fd82f5 Content-Type: text/plain; charset="UTF-8" The shell is gone. Once the program you executed is finished, there's nothing left for you to type at. Eahat's the terminal supposed to do with nothing running in it anymore? You can configure it to hang around so you can see the last thing output by the last thing to run in it... Exec has the same impact on the shell as exit - shell go bye bye - it just leaves another program in its place. Mark J. Reed On Mon, Jun 3, 2024 at 10:42 Ray Andrews wrote: > > > On 2024-06-03 07:17, Mark J. Reed wrote: > > The *exec* builtin replaces the running shell with whatever program you > run. The point is to avoid clogging the process table with shells that are > just hanging out waiting to do nothing but exit as soon as their child > process finishes. > > I get that. > > > In your case, the script exists to set things up in the environment and > then run xfce4-session; there's nothing for it to do after xfce4-session > completes, so it uses *exec* to tidy up. > > > Sure. But then what? I understand that if a script or function has > nothing more to do, it may as well pre-kill itself. But the difference is > that 'exec' kills the entire terminal, it doesn't just return to the prompt > in a more efficient way -- which would be easy to understand, as above. > exec seems to pull the rug out from under itself, not just end a script > more efficiently. In my case, from what I've heard control seems to pass > to dbus. Mind, if dbus called the script then that's what one might > expect. > > > --000000000000c12b3b0619fd82f5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The shell is gone. Once the program you executed is finis= hed, there's nothing left for you to type at. Eahat's the terminal = supposed to do with nothing running in it anymore? You can configure it to = hang around so you can see the last thing output by the last thing to run i= n it...

=C2=A0Exec has t= he same impact on the shell as exit - shell go bye bye - it just leaves ano= ther program in its place.=C2=A0

Mark J. Reed <markjreed@gmail.com>


On Mon, Jun 3, 2024 at 10:42 Ray Andrews <rayandrews@eastlink.ca> wrote:
=20 =20 =20


On 2024-06-03 07:17, Mark J. Reed wrote:
=20
The=C2=A0exec=C2=A0builtin replaces the run= ning shell with whatever program you run.=C2=A0 The point is to avoid clogging the process table with shells that are just hanging out waiting to do nothing but exit as soon as their child process finishes.
I get that.=C2=A0


In your case, the script exists to set things up in the environment and then run xfce4-session; there's nothing for it to do after xfce4-session completes, so it uses exec= =C2=A0to tidy up.

Sure.=C2=A0 But then what? I understand that if a script or function ha= s nothing more to do, it may as well pre-kill itself. But the difference is that 'exec' kills the entire terminal, it doesn&#= 39;t just return to the prompt in a more efficient way -- which would be easy to understand, as above.=C2=A0 exec seems to pull the rug out from unde= r itself, not just end a script more efficiently.=C2=A0 In my case, from what I've heard control seems to pass to dbus.=C2=A0 Mind, if dbus = called the script then that's what one might expect.=C2=A0


--000000000000c12b3b0619fd82f5--