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_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25214 invoked from network); 21 Jul 2021 20:40:47 -0000 Received: from tb-ob1.topicbox.com (64.147.108.173) by inbox.vuxu.org with ESMTPUTF8; 21 Jul 2021 20:40:47 -0000 Received: from tb-mx1.topicbox.com (tb-mx1.nyi.icgroup.com [10.90.30.61]) by tb-ob1.topicbox.com (Postfix) with ESMTP id 1F45B26E01 for ; Wed, 21 Jul 2021 16:40:45 -0400 (EDT) (envelope-from bounce.mMafc9e9d330eaec6c6ad1fe81.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx1.topicbox.com (Postfix, from userid 1132) id 1986C2E4A3FE; Wed, 21 Jul 2021 16:40:45 -0400 (EDT) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=J2B538Gk header.a=rsa-sha256 header.s=20161025 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; spf=pass smtp.mailfrom=inkswinc@gmail.com smtp.helo=mail-yb1-f169.google.com; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (body has been altered)) (Message modified while forwarding at Topicbox) ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type:content-transfer-encoding :list-help:list-id:list-post:list-subscribe:reply-to :list-unsubscribe; s=sysmsg-1; t=1626900044; bh=dBbLNzh3yOY88ohO NPZPqu8f0ImiOCpDi2k/QsXo9Qs=; b=cKffebenoz3vkmZijxEikcd0YpO5a3DA iJ/MDTNQCDWXFfZy/4njAdEhvthVShVyW976sjIAEcOpHiHWo4g0zYmvZexLDaKS YqvkHry8Vo91+Deb3tsvpz1TCQWKRm5mTsv8lma4zZA4qvnLLwUqr2SXgGSJWJBb huIunu/bifc= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1626900044; b=r4wufSDE1+Y+nF0eRrx17iFJntCmEcmKEJaP6nbm1Zr6FUKYuF DpjWfhkYHDrLcfDwy/IIus67k+sCHPmgiQmzVnTdDEYzqmzflFDi8TrkzfnjylmO t1lt1dVG1PUAZi2l7Aq11rBmmhu5flpPeEqjv08QtgzdElX8jnqFBCCgc= Authentication-Results: topicbox.com; arc=pass; dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=J2B538Gk header.a=rsa-sha256 header.s=20161025 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; spf=pass smtp.mailfrom=inkswinc@gmail.com smtp.helo=mail-yb1-f169.google.com; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (body has been altered)) (Message modified while forwarding at Topicbox) X-Received-Authentication-Results: tb-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=J2B538Gk header.a=rsa-sha256 header.s=20161025 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.219.169 (mail-yb1-f169.google.com); spf=pass smtp.mailfrom=inkswinc@gmail.com smtp.helo=mail-yb1-f169.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=DMgXSEoo; x-me-sender=none; x-ptr=pass smtp.helo=mail-yb1-f169.google.com policy.ptr=mail-yb1-f169.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: alt2.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: alt2.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h= mime-version:references:in-reply-to:from:date:message-id:subject :to:content-type:content-transfer-encoding:list-help:list-id :list-post:list-subscribe:reply-to:list-unsubscribe; s=dkim-1; bh=nlEkmsvPTusassR6P017gpB5lV8UargEi2WDGqk4DoI=; b=EHzGqmTzKoPv HjC4tkK3Q7l2EMBoHXJ+wldsbv2elT8gW6ffrXxAuzgrnmtT9Fnm4zuPJE+utSTH O8lWGWKQUh1PGnGNSkszegmDcMysNkPjBvQXmLVAV9eEhi8cFC95e01LdrIZI+MW fBv/el4MUmTozWyUvtDOMkvqk2QPxX4= Received: from tb-mx0.topicbox.com (localhost.local [127.0.0.1]) by tb-mx0.topicbox.com (Postfix) with ESMTP id 47B122E21BC5 for <9fans@9fans.net>; Wed, 21 Jul 2021 16:40:27 -0400 (EDT) (envelope-from inkswinc@gmail.com) Received: from tb-mx0.topicbox.com (localhost [127.0.0.1]) by tb-mx0.topicbox.com (Authentication Milter) with ESMTP id EC03EFC106F; Wed, 21 Jul 2021 16:40:27 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1626900027; b=fL0FTW+UihI7ygCNIV6hu7Vzy8JQ7QdgMXQFcFfg7DzobsSNtp zg8OjU9L3wXowN7Pr4gNN3l3uVvbw0zaQYdp+dZcl/X8Chi5EyJdXDaHrWiSbwiX 6nd6gaa9CVuHNmVKkW3nA9y+2iqO9UaO0WsgkirULV+khnuij5zA4CXGMm4NHpx+ kYXwuQ4bRoWm2PRiODyAS5aT/fMrmmsxpRa8q5xFtjXW/6+874+rgLrUBv5kzkXD +6Hl+fGq6pYIK0NDW+6swSrL9qfvy/yB9N/7f5DRrdYF0z6B+rylAjdeDXehDYyc bY68E78JiPzpb6Q/Fheg/XlhRhzgKu+jZm5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type:content-transfer-encoding; s=arcseal; t=1626900027; bh=Ctsogv6Me7VkbUI6kzjuC8w1W5TUKFIeNfY 8o2ElZrM=; b=LdM1XSrZfkHYSBzBKsvDa7G4+C4SQ4g5pv8V9uRhcciXVkwXn20 Pq2m7bwGOAxJG7huPYEVyLx4kWZiEWY0Hd9SA/G0NuLMRR7yJGqUCI4O05dedw2F IWef/3fKpnu55dbGkQMNrHRD6pTEuEL1xXh2TKCMNlhja49azTZVlwzSzj3yPO9A 2tks1jhRS5vCbD9PgUljXjUWyMdbv2vLK2wYc95zZBlLUDteLEebmm4smpA21xe6 sFo6xaZcRaQQAH/TzXrGKZRkCb6ydSkEiC/ml39J3MOtEsUwsukkZR52iakka1Ft f1TfiBTowNtWxuvkGS2O8cyBXlnvSC2sYtw== ARC-Authentication-Results: i=1; tb-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=J2B538Gk header.a=rsa-sha256 header.s=20161025 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.219.169 (mail-yb1-f169.google.com); spf=pass smtp.mailfrom=inkswinc@gmail.com smtp.helo=mail-yb1-f169.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=DMgXSEoo; x-me-sender=none; x-ptr=pass smtp.helo=mail-yb1-f169.google.com policy.ptr=mail-yb1-f169.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: alt2.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: alt2.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgedvtddrfeeggdeiudculddtuddrgeduledrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghn shhusghstghrihgsvgdpuffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtne cunecujfgurhepgghfjgfhfffkuffvtgfgsehtqhertddttdejnecuhfhrohhmpefuihhl rghsucfotgevrhhoshhkvgihuceoihhnkhhsfihinhgtsehgmhgrihhlrdgtohhmqeenuc ggtffrrghtthgvrhhnpeevgeegkedtfeegfefgfeehffeggfelvdfhjeehvefhveevfeeg udejteeltedvgfenucfkphepvddtledrkeehrddvudelrdduieelnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehinhgvthepvddtledrkeehrddvudelrdduieelpdhh vghlohepmhgrihhlqdihsgduqdhfudeiledrghhoohhglhgvrdgtohhmpdhmrghilhhfrh homhepoehinhhkshifihhntgesghhmrghilhdrtghomheq X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (gmail.com ... _spf.google.com: Sender is authorized to use 'inkswinc@gmail.com' in 'mfrom' identity (mechanism 'include:_netblocks.google.com' matched)) receiver=tb-mx0.topicbox.com; identity=mailfrom; envelope-from="inkswinc@gmail.com"; helo=mail-yb1-f169.google.com; client-ip=209.85.219.169 Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx0.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Wed, 21 Jul 2021 16:40:26 -0400 (EDT) (envelope-from inkswinc@gmail.com) Received: by mail-yb1-f169.google.com with SMTP id y38so2174432ybi.1 for <9fans@9fans.net>; Wed, 21 Jul 2021 13:40:26 -0700 (PDT) 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:content-transfer-encoding; bh=Ctsogv6Me7VkbUI6kzjuC8w1W5TUKFIeNfY8o2ElZrM=; b=DMgXSEooT2nP/rJ4hmw1hUi8I7/eOl9WL8/dDaB8+PVN/M2WNu2Gr0wOGXH55FtnEA HD5pyQjcAP3ngfwSf5rFalZ5tud8B2HsXpaB9fpFU0M8p0dedvQvrihGL4RsbXZtPUAt uyWzR1kBdff/WLzFMAckzaVyH6d6XcPmOoPdsELSYs8pqCLvik/OhZuuE7gmRtZl82/5 8iEXyXymH9OVHtfPgE3pc1Q2rVyBkfovEnw3+l7NcPPZsQmdVarbSS/d2Es03AAbMPZy yCLsm+fJt7z2Op/VOPYB4Pa8K09a8JDoL+XHapAMBCnSobO9hRGFiOOnLa1rJSIoRm5X f9wQ== X-Gm-Message-State: AOAM532Duoh8Sa4+Idm/OjAn1SIJdxKQ8tYvaUL25828SbxV0jgo7ahT TgXhtOdYeUwwtf5IvMOMEm9Ww7KunpFhvFU3gXkNDRqV7Q4= X-Google-Smtp-Source: ABdhPJwNXjcq39GD817TGFIC4Z5zjduDfxUGyHgnKp6drJcFOlXJrz6nppdTV5/wCHtHqQEJiPM+vRCBlZZw0qg4a8U= X-Received: by 2002:a5b:c0a:: with SMTP id f10mr46297137ybq.9.1626900026041; Wed, 21 Jul 2021 13:40:26 -0700 (PDT) MIME-Version: 1.0 References: <12EE8A453FB0C68676D9386EDFB20D85@prosimetrum.com> <16268645430.F3c80C30.923600@composer.9fans.topicbox.com> <16268925980.f49B8.19950@composer.9fans.topicbox.com> <16268932310.d97D.134284@composer.9fans.topicbox.com> In-Reply-To: <16268932310.d97D.134284@composer.9fans.topicbox.com> From: Silas McCroskey Date: Wed, 21 Jul 2021 13:40:15 -0700 Message-ID: Subject: Re: [9fans] Help with a sam cleanup script To: 9fans <9fans@9fans.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: e48bad38-ea63-11eb-8376-b5dd691657d0 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UMTBiMWQ1NTlhZTdkOTgxZS1NYWZjOWU5ZDMzMGVhZWM2YzZhZDFm?= =?UTF-8?B?ZTgxPg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:Mafc9e9d330eaec6c6ad1fe81:1:GkXvGarZNCkTQJ2iDC6M7wCGFUZ6yjB41mqMxzRPq-M # is, for better or for worse, an address in sam: #n The empty string after character n; #0 is the beginning of the file. If you're talking about running the script with ^, it's just an executable. You can put whatever you want in the shebang line; I tend to use the following: #!/bin/sed '/^#/d' # this line is ignored ,x/\*|^ +| +$/d # this line is also ignored ,x/ +//c/ ,x/[=E2=80=98=E2=80=98=E2=80=99=E2=80=99=E2=80=9C=E2=80=9D=E2=80=98=E2=80= =99]/c/" ,x/\\p|\\b/c/\n\n\n ,x/\n\n+/c/\n Running this as a script outputs only the lines in the file not beginning with # for interpretation by sam. To use it with ssam -f, you'd have to use the output rather than the file directly. In rc: ssam -f <{script} In bash: ssam -f <(script) both send the output to a temporary fd and then return a virtual file path to that fd for commands like this that expect a file path. If you really want comments within the sam language itself, the best I came up with after 5 minutes of thinking was: x/$^/!# i.e. run a commented out shell command when an impossible pattern is matched. The x// is needed to avoid actually launching the shell, and the !# is needed to avoid interpreting the characters following as another sam command (even if it's one that would never be run). - Silas ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T10b1d559ae7d981e-Mafc9e= 9d330eaec6c6ad1fe81 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription