From owner-freebsd-bugs Sat Oct 27 16:38:38 2001 Delivered-To: freebsd-bugs@freebsd.org Received: from net2.dinoex.sub.org (net2.dinoex.de [212.184.201.182]) by hub.freebsd.org (Postfix) with ESMTP id B2FE737B407 for ; Sat, 27 Oct 2001 16:38:34 -0700 (PDT) Received: from citylink.dinoex.sub.org (uucp@localhost) by net2.dinoex.sub.org (8.11.6/8.11.6) with UUCP id f9RNc8J04058 for freebsd.org!freebsd-bugs; Sun, 28 Oct 2001 01:38:08 +0200 (CEST) (envelope-from citylink.dinoex.sub.de!operator%disp@citylink.dinoex.sub.org) X-MDaemon-Deliver-To: freebsd.org!freebsd-bugs Received: from disp.oper.dinoex.org by citylink.dinoex.sub.org (8.8.5/PMuch-B3b) with ESMTP id XAA05645 for ; Sat, 27 Oct 2001 23:46:37 +0200 (CEST) Received: (from operator@localhost) by disp.oper.dinoex.org (8.11.6/8.11.6) id f9RLmMj14875 for freebsd-bugs@freebsd.org; Sat, 27 Oct 2001 23:48:22 +0200 (CEST) (envelope-from operator) Date: Sat, 27 Oct 2001 23:48:22 +0200 (CEST) From: System Operator Message-Id: <200110272148.f9RLmMj14875@disp.oper.dinoex.org> To: freebsd-bugs@freebsd.org Subject: handling figures above 2/4 billions Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Hello together, after upgrading from 2.2.1 to 4.x I noticed all my backup-shellscripts were broken. (These are kind of a simple tape-library, self-written). Obviousely, the bytecount on tapes reaches well beyond 2G/4G. On 2.2.1, expr could not handle such figures. But awk could. awk strangely changed from left-justified to right-justified when figures went beyond 2G, but the math was correct. Now with 4.x RELEASE, awk does something much more stupid: $ awk 'END{printf "%-.20d\n", 4200000000}' < /dev/null 00000000004200000000 $ awk 'END{printf "%-.20d\n", 4300000000}' < /dev/null 4300000000 This is not useful at all. ( %-.20d is the only formatstring that prevents awk from automati- cally switching to scientific float representation.) As far as I see, expr is now capable of handling such large figures. So possibly expr is the way to go on 4.x. I will not file a bug-report because I do not know if awk is designed to do 64bit-math at all (or if it just worked by chance in 2.2.1). I also do not know what kind of sense could be seen in this zero-filling (if any). So whoever might know why this was changed in awk (or in the underlying lib?), may just drop me a note. rgds,PMc P.S. I will currently not search for this myself, because getting my backup-engine running again is much more vital to me. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message