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.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_EF,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 697C4289CA for ; Mon, 3 Jun 2024 16:42:43 +0200 (CEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1717425763; b=rS0ww7taLlUOyLOp1/xftmfHdkDDIzLag4i7Ke8aLQ8jCpI8KtR9cjYKayPeBeFShNykBY/eBJ cqLRSU0URCJ0BL9W3RrKMCBgzzK6MQCzc7dXpa5QcR+7kb1TZIQ+7gUxBd/T740ONfblALwQvj YrkCY/50YZhu9WqfQSKDdDO+31W2cfQiXGylNfBa0rGxC0MTAiyvipx1luVJ7NYwF6O53iyi6W 5XBbN/yOhlleDvtszdpbe4k2pi/u2SB+IuJgGUwNl/WcbythCrWD2m0OVh4qZFIAmOy0R4E17l BPnMMnNbKFf2IRUQJ6fTaTrmZyieATGSW50OIxC9xjJvQA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1717425763; bh=ZVSc9Ucf6c7dfFpBQpk+3mERaO+u7p1O9fWsWjySVrQ=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Content-Type:DKIM-Signature; b=aAvGF63vasrgWv5pjjCBQ5dvTJqnJEzhPmnMwrU39r88Z16Eke+yegrsLUcSgB6HgszOppscZJ Oed4ye2vwls7zw21ZfL4mbKKBPt9pqiltaR1vZuf57Qyye+WQ5iAYkBulEcr/twzGKztvkeKZ5 TbHuzSwyShlYntTVzFrpJi4/KnxqhCkGxbrujqXUuRnctEZ+1SRL99fGuU/wbyx4AokX1PMLmu 1gVlTJOSbdmk5A4bRSbTvBcXQ5Fi7+xReQyU1MPUdID12AYsz5MTtXh1AKnxCA+5bLJ1Hm5inr zu3Q6a5sk/ZyTOm1d02mtU384CNLB4R8hEK2Mu5sFBheMQ==; 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:In-reply-to:From:References:To: Subject:MIME-version:Date:Message-id:Content-type:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=BbtTVkyF8g4Qzdm6fC/B4QRK8wwSGpkEpI9n97x5E4c=; b=K8Xz6WyLtTgpEwRUy3KSSDPiFv UXE3t9MOMt7YRBr+iQktg81tZHgIbo5jUjHiAwD9zYQrY/8boeBNnUiy1daARVsbgJ24Ci0HPK5Tp e3I/VNju6i1OaUerCmmHp3M3ocoCuwrD/N9Q3m0jPF7Z2F606fdJp7haL+LwvOkXl6nVg45fKPKYA 9QEBeqxBI0/SLEsiB9c9/p7SAnZI66qYPMFrLkke6Nwkm5kjMaFW4TGdffswoJZjlKfUBNB8I4G2d Rh1gr0J6SxraTZb01f0p91pGEKPzNQhH6dbN96RWeZebtm37qV8sSDdRfxjgJ8fSYkCYYEXpVwTkJ c2Pj5Zuw==; Received: by zero.zsh.org with local id 1sE8tX-0001Kz-9h; Mon, 03 Jun 2024 14:42:43 +0000 Authentication-Results: zsh.org; iprev=pass (mta04.eastlink.ca) smtp.remote-ip=24.224.136.10; dmarc=none header.from=eastlink.ca; arc=none Received: from mta04.eastlink.ca ([24.224.136.10]:54369) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1sE8su-0000Zj-NQ; Mon, 03 Jun 2024 14:42:05 +0000 Received: from csp02.eastlink.ca ([71.7.199.167]) by mta04.eastlink.ca ([24.224.136.10]) with ESMTPS id <0SEI0VZVQE15FC90@mta04.eastlink.ca> for zsh-users@zsh.org; Mon, 03 Jun 2024 11:42:03 -0300 (ADT) Received: from [192.168.0.15] (host-24-207-19-13.public.eastlink.ca [24.207.19.13]) by csp02.eastlink.ca ([71.7.199.167]) with ESMTPSA id E8sssAjvV08rzE8stsUoCQ (version=TLSv1_2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256); Mon, 03 Jun 2024 11:42:03 -0300 X-Authority-Analysis: v=2.4 cv=b+UR4cGx c=1 sm=1 tr=0 ts=665dd63b a=e7T7DzMKK1R988ZCg0wLyw==:117 a=e7T7DzMKK1R988ZCg0wLyw==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=6xQwR7zmrSrcW5xmtQgA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=pGLkceISAAAA:8 a=O24GhYbvsiilep9LvPMA:9 a=c5eYllSZwZ-ik-jC:21 a=_W_S_7VecoQA:10 X-Vade-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdelvddgjeelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecugfetuffvnffkpffmpdfqfgfvnecuuegrihhlohhuthemuceftddtnecunecujfgurheptgfkffggfgfuvfhfhfgjsegrtderredtvdejnecuhfhrohhmpeftrgihucetnhgurhgvfihsuceorhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrqeenucggtffrrghtthgvrhhnpefhteethfevgeeuvdelgefgvdevudefueduffdvgfelvddvgfdtieegueeuleeifeenucfkphepvdegrddvtdejrdduledrudefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepvdegrddvtdejrdduledrudefpdhhvghloheplgduledvrdduieekrddtrdduhegnpdhmrghilhhfrhhomheprhgrhigrnhgurhgvfihssegvrghsthhlihhnkhdrtggrpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepreerpdhrtghpthhtohepiihshhdquhhsvghrshesiihshhdrohhrghdpghgvthdqkghiphfrrghsshifugepthhruhgv X-Vade-Score: 0 X-Vade-State: 0 X-EL-AUTH: rayandrews@eastlink.ca Content-type: multipart/alternative; boundary="------------d0yvPARWOmT17yl9KEyq5DqF" Message-id: Date: Mon, 3 Jun 2024 07:42:02 -0700 MIME-version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: exec To: zsh-users@zsh.org References: <2bb9cec5-1293-4103-a73c-fd2a190cb65d@eastlink.ca> Content-language: en-US From: Ray Andrews In-reply-to: X-Seq: 29981 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: This is a multi-part message in MIME format. --------------d0yvPARWOmT17yl9KEyq5DqF Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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. --------------d0yvPARWOmT17yl9KEyq5DqF Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

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. 


--------------d0yvPARWOmT17yl9KEyq5DqF--