Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: exec
- X-seq: zsh-users 29982
- From: Eric Cook <llua@xxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: exec
- Date: Mon, 3 Jun 2024 10:50:42 -0400
- Archived-at: <https://zsh.org/users/29982>
- In-reply-to: <aa551662-225c-44b4-8449-d56bd05cef7d@eastlink.ca>
- List-id: <zsh-users.zsh.org>
- References: <2bb9cec5-1293-4103-a73c-fd2a190cb65d@eastlink.ca> <CAA=-s3xr_GoeqRRAf+UBQQR8NiOz_Sy6=456SeAq1-+ens1rZA@mail.gmail.com> <aa551662-225c-44b4-8449-d56bd05cef7d@eastlink.ca>
- Ui-outboundreport: notjunk:1;M01:P0:5qtBpGTQ5IY=;dXTPUqeZHOhP9E5V7hOQFA92fDp u00yu8BGYhHXYvBGvI8+xrmeL2MSoGFpYrmdNjcE3A+0fgVDMb55pFC5fivCMOfBgiBXpD0IH NO3YpK8fEiEsnyi0wSTG11BlL2QtTACRNCLevwz9J5sK8PEQNciolrAuyLC6NEO4Ss2aMUt5u 4er1vYiQDJhgZBKn++s1YTIZUXqpWdCsuRhAB6/+e35HxeomghumlBVmSU/Pya8klzKlexLQT LbFV1IYvI8lc7WLeUZjR9SAdx+ie3CHpXBF3SfeILotYtNrOtbLecpg2ZClQnvfGffTUI8Rtt RIlu4n/MM6kU76Yx2gpM6c4+CoiVrzJC69ifL0Qox6vAfKa6aXqSGzvRjtVeFaaEr0E4BA6np P9T4aceWTs/GtRjmmu4Lf73Y8cngRUXGWnYM3cxVUZnJqKe/iHuFNkqmHFsalurTpukz/smoI Vd0u7SQ5oKY7tBoogtF0+GcfeRr3hZs8iIzW/tbocieiTrTMcXC+CzICr04xlQ95CaF7SmRkH x3gQMEJXoekO54VB8x88e6jlZ1QlDUQENiSx8QasXlo0FNCJ5BXtMQObUfz5Nqs18R4lbzRZH /OMziHp1MnIiUghJepX166P4zFc5yCwtVpcbmOJuib3LMOXbdsfr/22AmNqdBmAwKi5axBrYU ELEydmYb3n1h5Uc837EadihUYg59COs5PfS/sr5TBlvOi49uvB6xFQyLUQjhgm/f036xGyQBI nCFLMddNwjGBhtGfuI3Nng+pJsnjt3S+A6li3k6YhT0j15xl0kiOzxPa7AOKFqlVjpXtS9lQW xi8nDMap+fW2guY1Zx7pkLxbdVFu0s/HOa9m7IC5xMpJo=
On 6/3/24 10:42 AM, 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?
nothing, the process was replaced with xfce-session.
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
How would it return to the prompt of a shell/process that was replaced with another process?
when you have a `terminal -> shell' and you run exit/^D the terminal no longer has a child process and exits.
when you have a `terminal -> shell that does exec -> utility' and utility exits, the terminal no longer has a child process and exits.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author