From owner-freebsd-questions@freebsd.org Wed Mar 31 20:54:12 2021 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C50745B02FC for ; Wed, 31 Mar 2021 20:54:12 +0000 (UTC) (envelope-from olivares14031@gmail.com) Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F9dpW6K4Vz4dVr for ; Wed, 31 Mar 2021 20:54:11 +0000 (UTC) (envelope-from olivares14031@gmail.com) Received: by mail-wm1-x332.google.com with SMTP id m20-20020a7bcb940000b029010cab7e5a9fso1780941wmi.3 for ; Wed, 31 Mar 2021 13:54:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2NmyCZTONq+/D9UXgorpNxQox+xvbyiNHncZrMazYig=; b=pA7eLNIK9kosDmb1F7PszDCE1/v1ZbPad6+Cqxf7njUUlz4+UC2KwuECpe81BYqDDk bhagO7T8bkgjyh/xVMqADiw/ca2lXG4Dpqe1vPMrGiYH3AF1pKxhmO0vtALxQucDjw94 W7WBsM5vOMbXmMSjgvIRKmE2T8QiSXf5dQwMxEMvIU2I6alBSsNCoovyzC+UZdEfQY3g tJL7yvD8Pp3zhJM76evoE0jw3SFth6E4dphh4eD3x8stUcoyXSjjapxPTqu6eXiyE/Gf tMFDkvEu3ldcxw529GrGE2TT3IHCu+xOTdpvW83/bpXlDmswLCU3Lz4rBWhqxCcC/osx 1ZyA== 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=2NmyCZTONq+/D9UXgorpNxQox+xvbyiNHncZrMazYig=; b=qt6VmpLfFDamFuXX8k0I5IlWf/pPIcTZ0Z9eexa/ABr3JDXBmuECY8QJGwjckGoDJo SNyAf0MHY0Sql7Z7PbTYUtDAZJe0HXVRL7CZOzYUBExsoRu0nlskOSXT5NVkd3fo1kph xXy3iZ6bZp6lVSYUZFB5u8ZbVXmEzHvkkXMzD3+FVDeZmpIQ5pMkzAjYtsklePvpWHPW r7RG247G9WNHiB9N7jCWR9P5C0McZqPLe0MGo6D9zoztTqfj50yU1BiBG2ltDDnAmFbK 71iEGKUb1V7mrnEtl6geT/fwAlDRIf1ROjC4KFRggLXXlEhN8iH3KRWT1IAUYOWuSNr4 niDg== X-Gm-Message-State: AOAM531KKHdCMaeVQWjAFEbZi6mM20sOIzte7DwBQYSVZuDCnmpP6u16 Qrh7i9U0Tu1NEpKPQ8AAM7LIwHO9Sdau1BqR0u5xeeejB9xY0g== X-Google-Smtp-Source: ABdhPJx/LeYPXux3wfWZpUrWMiEnBW1qHDPbJ1HrAsX6IuY14P+HparVWSwCqy+P/OqKq3JxpAlc55J5KpHJuIbqChw= X-Received: by 2002:a7b:cd8f:: with SMTP id y15mr4857690wmj.185.1617224049650; Wed, 31 Mar 2021 13:54:09 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Antonio Olivares Date: Wed, 31 Mar 2021 15:53:58 -0500 Message-ID: Subject: Re: an easter calculating script that uses dc, output does not stop To: Paul Procacci Cc: FreeBSD Questions Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4F9dpW6K4Vz4dVr X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=pA7eLNIK; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of olivares14031@gmail.com designates 2a00:1450:4864:20::332 as permitted sender) smtp.mailfrom=olivares14031@gmail.com X-Spamd-Result: default: False [-2.00 / 15.00]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a00:1450:4864:20::332:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; SH_EMAIL_DBL_DONT_QUERY_IPS(0.00)[0.0.0.21:email,0.0.0.24:email]; NEURAL_SPAM_SHORT(1.00)[1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; SPAMHAUS_ZRD(0.00)[2a00:1450:4864:20::332:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::332:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-questions] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Mar 2021 20:54:12 -0000 On Wed, Mar 31, 2021 at 3:44 PM Antonio Olivares wrote: > > On Wed, Mar 31, 2021 at 3:33 PM Paul Procacci wrote: > > > > It does not output continuously for me. > > > > # uname -a > > FreeBSD nas.myhome 12.2-RELEASE-p4 FreeBSD 12.2-RELEASE-p4 r369444 GENERIC amd64 > > > > On Wed, Mar 31, 2021 at 4:30 PM Antonio Olivares wrote: > >> > >> Dear kind FreeBSD users, > >> > >> I found a script which I will attach inline. It uses dc *to do the > >> math*, but the output runs indefinitely on FreeBSD machines. > >> > >> From > >> https://forums.opensuse.org/showthread.php/435983-Easter-program > >> > >> <----- script follows -----> > >> > >> #!/bin/sh > >> if test $# -lt 1 > >> then > >> echo usage: $0 year > >> exit 1 > >> fi > >> echo $* '[ddsf[lfp[too early > >> ]Pq]s@1583>@ > >> ddd19%1+sg100/1+d3*4/12-sx8*5+25/5-sz5*4/lx-10-sdlg11*20+lz+lx-30% > >> d[30+]s@0>@d[[1+]s@lg11<@]s@25=@d[1+]s@24=@se44le-d[30+]s@21>@dld+7%-7+ > >> [March ]smd[31-[April ]sm]s@31<@psnlmPpsn1z>p]splpx' | dc | tr '\012' ' ' > >> echo '' > >> > >> <----- end of script ------> > >> > >> I ran the script successfully during prior versions of FreeBSD, but it > >> is now running infinitely( infinite loop). See run: > >> > >> ... > >> to run we put > >> $ sh easterdc.sh > >> and the year > >> olivares@deepcool:~/Downloads/kerTeX/Documents $ sh easterdc.sh > >> usage: easterdc.sh year > >> olivares@deepcool:~/Downloads/kerTeX/Documents $ sh easterdc.sh 2021 > >> ........ > >> 4 April April 4 April April 4 April April 4 April April 4 April > >> April 4 April April 4 April April 4 April April 4 April April 4 > >> April April 4 April April 4 April April 4 April April 4 April > >> April 4 April April 4 April April ^C > >> > >> .... > >> > >> How can I fix this to just output 4 April and stop. Thanks in Advance. > >> > >> Regards, > >> > >> > >> Antonio > >> _______________________________________________ > >> freebsd-questions@freebsd.org mailing list > >> https://lists.freebsd.org/mailman/listinfo/freebsd-questions > >> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > > > > > > > > -- > > __________________ > > > > :(){ :|:& };: > > olivares@e154-1$ sh easterdc.sh > usage: easterdc.sh year > olivares@e154-1$ uname -a > FreeBSD e154-1 12.2-RELEASE-p4 FreeBSD 12.2-RELEASE-p4 GENERIC amd64 > olivares@e154-1$ sh easterdc.sh > usage: easterdc.sh year > olivares@e154-1$ sh easterdc.sh 2021 > 4 April 2021 > olivares@e154-1$ > > On 13.0RC4 it goes infiintely :( > > Best Regards, > > > Antonio I am looking at the specifics to find out what changed, I have found this: https://cgit.freebsd.org/src/commit/?id=c41fef90a7d Contributed Software Replaced the bc(1) and dc(1) utilities with the version developed by Gavin D. Howard. The new versions do not depend on an external large number library, offer GNU bc extensions, are much faster than and fix POSIX compliance issues of the programs they replace. They support POSIX message catalogs and come with localized messages in Chinese, Dutch, English, French, German, Japanese, Polish, Portugueze, and Russian. The previous implementation is still available in FreeBSD-13 and can be selected instead of the new one by the build option WITHOUT_GH_BC. c41fef90a7d I like to use bc and dc with some scripts to calculate things and used this script. I do not mind the changes, all I would like to see if it is possible to add something to script so it can stop like it used to before. Best Regards, Antonio