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.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1270 invoked from network); 16 Dec 2020 04:42:26 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 16 Dec 2020 04:42:26 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 19FD89C82B; Wed, 16 Dec 2020 14:42:25 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 5FBE69C7BB; Wed, 16 Dec 2020 14:42:05 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=algebras-org.20150623.gappssmtp.com header.i=@algebras-org.20150623.gappssmtp.com header.b="eFs97QYi"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 449699C7BB; Wed, 16 Dec 2020 14:42:02 +1000 (AEST) Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) by minnie.tuhs.org (Postfix) with ESMTPS id 862E79C7B5 for ; Wed, 16 Dec 2020 14:42:00 +1000 (AEST) Received: by mail-lf1-f49.google.com with SMTP id y19so45027625lfa.13 for ; Tue, 15 Dec 2020 20:42:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=algebras-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=if2Rhot8Nq3kSIWQjNmWm+S5ah0dEruQb9VmkYRvKp0=; b=eFs97QYiaEY3GnqLoc0oM9TISEaja06TGWpDWxh5e9yLerpahz4KQRC2XoKoq6aLFq YPLuz10uCMJxeSh2GjlZOVnvj6v47gWdgXhCj+Fcfgb/9pTu/VzHg+2DyOQxR1VbMzOT 02XM2L3GaT48bPOKwu+Xgz8v7CPSP/xKzr0/9r4dxR8XTaUSHepstWMIH6+xRXrz6+lN 0V9DVfwdlwKK80Oxmq9mNjET8KQ8STOihl+Z24AlwH8NRo2QmRiON6bLXfmp1AiI3PTC Nc1+iadSiI1GqJ1VIlu6iwD9N1VB/gF6TJ3J2jsiAfn10UZXge/JAMbSTqcVYikhBADY HQxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=if2Rhot8Nq3kSIWQjNmWm+S5ah0dEruQb9VmkYRvKp0=; b=qcffLbLGPLPV0CJ6JdWofrXPm754Ah0QIheeerzwYe5BRL4xhvU22qTB0ElUhzCT+R KDknq60YdcCas7VwVDDFC4mMDkWBRMzMWwO2a/WvaP9ZMxbhSTxxbdjo99nppXdz3vpx zu+W4k/q2K3nR2tml70VdrFuBtb6r0la9A2he1iOfexfActNucPBrdN/rlgOIOfnLlKe EPY1yCuzWYiG0dLvXfzaL7oKOh5w3mTTTNtVoxqZz956KNLcMs4i+bN+qAS/CGWRpzFF Fz3Mg2HMKbrY6dY4I4SG8M/2i88QM7F2CiZFmnn9XNs0Goq0b7ICCEN31Tzo4Urjzb3Z Y6Yw== X-Gm-Message-State: AOAM5311GvjpgpX7h7KCUR7IX484GNYE5aYcQwcO20f7xVLMOtAtgF6e aW65jEaoogfRrMplT7+Bz8S7GKWwJkT6nq3O4fQNtRjjls+CWg== X-Google-Smtp-Source: ABdhPJz2RiEkB/PAnLSUj0uyKIvS3Vd3/YOjS/kwW5xHER9PWr7lhoxw/cUYIRrjZfFfb+j9lph2M4wtN3blMr5eyQo= X-Received: by 2002:a2e:740d:: with SMTP id p13mr13892341ljc.288.1608093718961; Tue, 15 Dec 2020 20:41:58 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: George Michaelson Date: Wed, 16 Dec 2020 14:41:46 +1000 Message-ID: To: Richard Salz Content-Type: text/plain; charset="UTF-8" Subject: Re: [TUHS] sh and goto X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: TUHS main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" Great solution. Not entirely "side effect free.." On Wed, Dec 16, 2020 at 2:30 PM Richard Salz wrote: > > >> trap is a setjmp/longjmp type outcome. You pop up in a call you didn't >> exactly "plan" for (well you did: you wrote it. But you don't know the >> entry state which led you there, unlike normal program flow) -well, it >> is.. because you get there. > > > I once won a Usenix contest for using /bin/sh to test your reflexes. > > trap "ls | wc ; exit 0" 0 1 2 3 15 > ls * | wc -l > echo "Type ^C; see how close you can make your number match" > rm -rf * | wc -l > kill -1 $$ # For those without "trap 0" >