From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 5492 invoked from network); 31 Aug 2020 15:00:22 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 31 Aug 2020 15:00:22 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1598886022; b=AKZGYp4KMLshrhLx9e5Cx4GOHXGljZ3NdfwpG3pd5aV0vm1deCoCp5zyOqy6usCOUh+j5BwC0O MKrapChHX4HTJSue6Y9Df+aWfaWFAh4UvO3BsqmYh/JcJZ/u/Els04KGe/GGsTTmu4AawF4Kgb xZWabPF0jIkxyXhpTVaXvBqobcKiUUCa0EkkkbcSbTPFZ6qHUsqUqfyRD36WmJ/BeIBqOTNSYo /RdItZlFelRdLQkDeReRQmjsjxCDXfEd1HxaCKfml0GQjxjBz6GbHwyuBc2RIXD0hAk+1miC0O 8ImRFwZXv+HOiDXnQUth9oiIgQiPwoLrmffxU+JLKG9tMg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-pj1-f47.google.com) smtp.remote-ip=209.85.216.47; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1598886022; bh=rJlEBQo4CKReSrmEtcRS4sTyqeTzGCSr/ksyeJSNSQI=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=KKE+gVO+i+YTUpybjIDtE+ykWvvyv8/Ga49WgtQiD40VNRViScQBPb9AAicerQcciwlEEFj6lF /hNCETasW+WcY5mDlTirpGzvyqS/oW8lFP70PJEXc6bG7GMizC11qRdRBAWZ1AwaosXajDohNz oe59EN1A4GscThfZojov6BwRfsaq9nl3BN956PSUXpI/OzfCl2sPQWZMUoEDobiUDxlWKYbDlo uBAqWsbzUn1MRBmOF3Rm0lTUMvhxRpPIls2o7GpDLS768RxXksw19ZL50aqdTNUp8J0wymiWWs m7SLbngG2GrbrFORz9D+AFcEjUnm8gOqTlviZSYCx5S0xA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=rJlEBQo4CKReSrmEtcRS4sTyqeTzGCSr/ksyeJSNSQI=; b=Vfw+XzEIdLQg+4P8T/g0o6dr2R GyR+aSMw/5cYuFTPWw/tpvflFg2sjWVDlSTTt8BOD/cNmDc+S1FnK8gaqFmLVmsnTUcOaJ68hcSaj iEDzwz4EdyvSqPnHU0OkL7XQSEScnuJeTt6xS7ihIXvRsoVMReZlBsSfD7h1F+NFt+hn/k2SSKuGy 2a0oVj4VmXQrdHZwoNWCvo8n2a3H0sUwx6rru1/FzuNBjsjM84CZJGI/WZzrylXTQQpBovsMAyymz 9E9H3BX5bMOAK7Znq/5CQcQO9EzUk5oAoAPyWf9ry+UnpyxscsdHkDO0hnqk8r1vPIB+/4eNpOVk1 bs51ASlw==; Received: from authenticated user by zero.zsh.org with local id 1kClIC-0007Xt-QV; Mon, 31 Aug 2020 15:00:20 +0000 Authentication-Results: zsh.org; iprev=pass (mail-pj1-f47.google.com) smtp.remote-ip=209.85.216.47; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-pj1-f47.google.com ([209.85.216.47]:34178) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kClHu-0007P1-RC; Mon, 31 Aug 2020 15:00:03 +0000 Received: by mail-pj1-f47.google.com with SMTP id n3so103836pjq.1 for ; Mon, 31 Aug 2020 08:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=rJlEBQo4CKReSrmEtcRS4sTyqeTzGCSr/ksyeJSNSQI=; b=lVOBwn5+lXZHTYeaJgfODhAbI/zxoRB7Yy/iE6BsUvwszzX/QIiAjyKclP+9dhUiTy WssksMjIrkoY0Q95dY16XQk6CYqYEF8xtGQ+zqAejZR8Vlykf+K/VrdAUYdCifzMV0dr xVTfwI51sjEIyiMni7TnjHrpNxUaNPImQrEtMD+sijUVEM/DDv37Y02SFLphNGX+Jvcr ao+2g5W/ovkPY0ImX911YZj+Pmi/fCCwYi2nZYBRyqBygDA/JdeSesUOXnHJOs3gTGSG H9OGlN+PebchtLyWSfzScEgMW3z8ZRxoiQ5yJVPH4a6N7LVxBUqjW7Ls9FXmKqGldU4c c6oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=rJlEBQo4CKReSrmEtcRS4sTyqeTzGCSr/ksyeJSNSQI=; b=HsBhQWh8vO4Wa09EnqKAm0UMEYzbnQpv6DKOOU76FvEOQoZ1jI6aDBzXCUxkF4CTew MxbKwkLmCW+LCCRQt9ugAS0UGRaB4m/vzxxsq26Immt/uLGCR66Qm6Wj1sD83NBXXI9o 0lWkvNapEXRj+zbkK8qga4oSGl8U/ubEOwtlYl+GErPPPji6lA1qCYSfFY2VJIKEuvqv sbCZFUq8cXauvPpH7awcgonDYYU+nDkTwHXpB+8MRbegwFXyzTzMkECnoXYtW4GHp94d fUOjXXBId4ViuL6umcAqIFD4htVdbOtjUhVMiYYSkWNo6oArXsDJKfdof9JQBr3pFmJl jjBg== X-Gm-Message-State: AOAM532nB+/yIoFYEJBpIjRg5bC+YF/eCmBDoTEHt7h9UzliHb+oGHbs KmwpXLmYpppMumBdYLlCy9UKfipWMIrK0ot/wgH7LKGXFwgxfg== X-Google-Smtp-Source: ABdhPJzhhj8BO0tg0C7AX8E+u3kRqj1AL3zo6YKx0Fdz+jzHWc0OxKz3Ni658OKPGWNoQL5zV5RNuT3Sn5Od/OCEtZY= X-Received: by 2002:a17:902:441:: with SMTP id 59mr1360591ple.282.1598886000422; Mon, 31 Aug 2020 08:00:00 -0700 (PDT) MIME-Version: 1.0 From: Rudi C Date: Mon, 31 Aug 2020 19:29:49 +0430 Message-ID: Subject: Is there a way to put a timeout on a function? To: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary="00000000000017726105ae2da8dc" X-Seq: 47354 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: --00000000000017726105ae2da8dc Content-Type: text/plain; charset="UTF-8" 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? --00000000000017726105ae2da8dc Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I need to limit the execution time of arbitrary zsh functi= ons. Is there a way to achieve this? I'm ok with just adding a time lim= it to all the external commands, but I do not know how to do that. (I don&#= 39;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 com= mand. I thought maybe these two problems might have similar solutions. Is p= rexec viable for them? Does preexec even work for noninteractive scripts?
--00000000000017726105ae2da8dc--