Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Apr 1997 10:33:35 +0200 (MET DST)
From:      Zahemszky Gabor <zgabor@CoDe.hu>
To:        freebsd-questions@freebsd.org (FreeBSD questions)
Subject:   Re: 'GET A LIFE' doesn't work
Message-ID:  <199704020833.KAA00431@CoDe.hu>
In-Reply-To: <slrn5k2vuh.583.sec@matrix.42.org> from Stefan `Sec` Zehl at "Apr 1, 97 11:36:18 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> So, so far for the difficult part, now why doesn't this work on FreeBSD ? 
> 
> it's the 'P' command of FreeBSD's dc
> on FreeBSD: echo '71Pq'|dc	yields "71"
> on SunOS:   echo '71Pq'|dc	yields "G"
> 
> 
> from the SunOS manpage:
>      P         Interpret the top of the stack as an ASCII string,
>                remove and print it.
> 
> from the FreeBSD manpage:
>      P         Prints  the  value  on the top of the stack, popping it
>                off, and does not print a newline after.
> 
> 
> so they don't even claim to do the same.... 
> The magic question is now, should this behavior be changed ? 

Under FreeBSD (on my 2.1.5) the dc is the GNU dc 0.2 version.  If I remember
well, there is a newer 0.3 version, included in the GNU bc package.  Maybe
it works well (if it is, this is the reason, why some Linux systems
generate the xyz..., the others the Get life string.)  Are there anybody,
with the newer GNU bc who can try it?

And another one: it reminds me to one of the winners of IOCCC, korn.c:

main()
{
printf( &unix[ "\021%six\012\0" ], (unix) [ "have" ] + "fun" - 0x60 );
}

Well, this cannot even compile on AIX systems - their ad's: The world's best
UNIX!  Of course, we can compile and run it on FreeBSD, and on most of the
UNIX machines, I've tried (most of them were mainly SysV).

Gabor



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