an easter calculating script that uses dc, output does not stop

Antonio Olivares olivares14031 at gmail.com
Wed Mar 31 20:45:07 UTC 2021


On Wed, Mar 31, 2021 at 3:33 PM Paul Procacci <pprocacci at 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 at 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 at 1583>@
>> ddd19%1+sg100/1+d3*4/12-sx8*5+25/5-sz5*4/lx-10-sdlg11*20+lz+lx-30%
>> d[30+]s at 0>@d[[1+]s at lg11<@]s at 25=@d[1+]s at 24=@se44le-d[30+]s at 21>@dld+7%-7+
>> [March ]smd[31-[April ]sm]s at 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 at deepcool:~/Downloads/kerTeX/Documents $ sh easterdc.sh
>> usage: easterdc.sh year
>> olivares at 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 at freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
>> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>
>
>
> --
> __________________
>
> :(){ :|:& };:

olivares at e154-1$ sh easterdc.sh
usage: easterdc.sh year
olivares at e154-1$ uname -a
FreeBSD e154-1 12.2-RELEASE-p4 FreeBSD 12.2-RELEASE-p4 GENERIC  amd64
olivares at e154-1$ sh easterdc.sh
usage: easterdc.sh year
olivares at e154-1$ sh easterdc.sh 2021
4 April 2021
olivares at e154-1$

On 13.0RC4 it goes infiintely :(

Best Regards,


Antonio


More information about the freebsd-questions mailing list