zsh-users
 help / color / mirror / code / Atom feed
From: "Mark J. Reed" <markjreed@gmail.com>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: zsh-users@zsh.org
Subject: Re: exec
Date: Mon, 3 Jun 2024 10:54:19 -0400	[thread overview]
Message-ID: <CAA=-s3zd8zunKBgkVUvUUt76pBq=SAsh-mR1W=Ej2OVvRbVH5A@mail.gmail.com> (raw)
In-Reply-To: <aa551662-225c-44b4-8449-d56bd05cef7d@eastlink.ca>

[-- Attachment #1: Type: text/plain, Size: 1553 bytes --]

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 <markjreed@gmail.com>


On Mon, Jun 3, 2024 at 10:42 Ray Andrews <rayandrews@eastlink.ca> 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.
>
>
>

[-- Attachment #2: Type: text/html, Size: 2717 bytes --]

  parent reply	other threads:[~2024-06-03 14:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03 14:10 exec Ray Andrews
2024-06-03 14:17 ` exec Mark J. Reed
2024-06-03 14:42   ` exec Ray Andrews
2024-06-03 14:50     ` exec Eric Cook
2024-06-03 14:54     ` Mark J. Reed [this message]
2024-06-03 15:16       ` exec Mark J. Reed
2024-06-03 15:29         ` exec Ray Andrews
2024-06-03 15:22       ` exec Ray Andrews
2024-06-03 15:33         ` exec Mark J. Reed
2024-06-03 15:59           ` exec Ray Andrews
2024-06-03 16:06           ` exec Bart Schaefer
2024-06-03 16:23             ` exec Ray Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAA=-s3zd8zunKBgkVUvUUt76pBq=SAsh-mR1W=Ej2OVvRbVH5A@mail.gmail.com' \
    --to=markjreed@gmail.com \
    --cc=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).