From owner-freebsd-questions Wed Apr 2 05:44:35 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id FAA00193 for questions-outgoing; Wed, 2 Apr 1997 05:44:35 -0800 (PST) Received: from mail.EUnet.hu (www.eunet.hu [193.225.28.100]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id FAA00184 for ; Wed, 2 Apr 1997 05:44:30 -0800 (PST) Received: by mail.EUnet.hu, id PAA19692; Wed, 2 Apr 1997 15:44:27 +0200 Received: (from zgabor@localhost) by CoDe.hu (8.7.5/8.7.3) id KAA00431 for freebsd-questions@freebsd.org; Wed, 2 Apr 1997 10:33:36 +0200 (MET DST) From: Zahemszky Gabor Message-Id: <199704020833.KAA00431@CoDe.hu> Subject: Re: 'GET A LIFE' doesn't work To: freebsd-questions@freebsd.org (FreeBSD questions) Date: Wed, 2 Apr 1997 10:33:35 +0200 (MET DST) In-Reply-To: from Stefan `Sec` Zehl at "Apr 1, 97 11:36:18 pm" X-Mailer: ELM [version 2.4ME+ PL11 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > 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