Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Mar 2021 15:53:58 -0500
From:      Antonio Olivares <olivares14031@gmail.com>
To:        Paul Procacci <pprocacci@gmail.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: an easter calculating script that uses dc, output does not stop
Message-ID:  <CAJ5UdcMJuaGmKYYBGTmNngV_dyvPWM2p9QEDH1w4CxQx18mBDQ@mail.gmail.com>
In-Reply-To: <CAJ5UdcObg48_XSNsdc1gffnQ9sGmq4URJxDMTBFJb=3wA8iJDQ@mail.gmail.com>
References:  <CAJ5UdcOHX%2BLrY0nmo4D4wF2uJgkOPebo1gn-uBV4KUQ1HPn7ZQ@mail.gmail.com> <CAFbbPugJZyUH6k4_RJw5LcVmWu6khyb4T9XbStMfNodF8rw7zQ@mail.gmail.com> <CAJ5UdcObg48_XSNsdc1gffnQ9sGmq4URJxDMTBFJb=3wA8iJDQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Mar 31, 2021 at 3:44 PM Antonio Olivares
<olivares14031@gmail.com> wrote:
>
> On Wed, Mar 31, 2021 at 3:33 PM Paul Procacci <pprocacci@gmail.com> 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 <olivares14031@gmail.com> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ5UdcMJuaGmKYYBGTmNngV_dyvPWM2p9QEDH1w4CxQx18mBDQ>