Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: auto-exec on last command



Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Aug 21,  9:33pm, Jorg Sommer wrote:
>}
>} is it possible to advice zsh to replace its process (with exec) with
>} the process of the last command?
>
> How is the shell supposed to know what command is the "last" one?

Because the next token is EOF and no TRAPs are defined.

>} Something like zsh -c 'setopt execlast; $myprog' or zsh -Xc '$myprog'
>} that runs the script 'exec $myprog'.
>
> I'm a bit puzzled.  If you know to set the option or pass the flag, why
> can't you just use "zsh -c 'exec ...' ?

Take cron for example. Modifying the SHELL variable would be easy, but
changing all entries is much more work. Or the window manager IceWM. I
can configure the shell that's used to run subprocesses for menu entries,
but modifying all menu entries, and some of them are build by third party
scripts, is expensive.

Bye, Jörg.
-- 
Gienger's Law (http://www.bruhaha.de/laws.html):
Die Wichtigkeit eines Newspostings im Usenet ist reziprok zur Anzahl der
enthaltenenen, kumulierten Ausrufungszeichen.



Messages sorted by: Reverse Date, Date, Thread, Author