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

[RESEND] Is there a way to put a timeout on a function?



Prescript: I sent this email 4 days ago, but somehow it is not appearing in the archives https://www.zsh.org/mla/workers/2020/index.html . This has happened with my other recent messages to the mailing list, and I am confused as to what is happening. Is this email being received but not put in the archives?

---

I need to limit the execution time of arbitrary zsh functions. Is there a way to achieve this? I'm ok with just adding a time limit to all the external commands, but I do not know how to do that. (I don't want to manually prefix all my commands with the GNU timeout command.)

On a sidenote, I would also like to make the shell stop forcefully (like when a glob fails) if it doesn't find an external command. I thought maybe these two problems might have similar solutions. Is prexec viable for them? Does preexec even work for noninteractive scripts?


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