From owner-freebsd-bugs Mon Sep 23 17:50:07 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id RAA01292 for bugs-outgoing; Mon, 23 Sep 1996 17:50:07 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id RAA01273; Mon, 23 Sep 1996 17:50:03 -0700 (PDT) Resent-Date: Mon, 23 Sep 1996 17:50:03 -0700 (PDT) Resent-Message-Id: <199609240050.RAA01273@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, roberte@mep.ruhr-uni-bochum.de Received: from ghost.mep.ruhr-uni-bochum.de (ghost.mep.ruhr-uni-bochum.de [134.147.6.16]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id RAA28823 for ; Mon, 23 Sep 1996 17:44:31 -0700 (PDT) Received: (from roberte@localhost) by ghost.mep.ruhr-uni-bochum.de (8.7.5/8.7.3) id CAA01605; Tue, 24 Sep 1996 02:44:17 +0200 (MET DST) Message-Id: <199609240044.CAA01605@ghost.mep.ruhr-uni-bochum.de> Date: Tue, 24 Sep 1996 02:44:17 +0200 (MET DST) From: Robert Eckardt Reply-To: roberte@mep.ruhr-uni-bochum.de To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/1673: sh's printf is broken Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1673 >Category: bin >Synopsis: sh's printf is broken >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Sep 23 17:50:02 PDT 1996 >Last-Modified: >Originator: Robert Eckardt >Organization: Home sweet home >Release: FreeBSD 2.1.5-RELEASE i386 >Environment: FreeBSD 2.1.5-RELEASE as from CD >Description: Number conversion of sh's printf is broken. sh's printf is meant as a replacement for the external program /usr/bin/printf for efficiency. For "%04d" leading spaces are printed instead of leading zeros. For "%4.2g" the letter 'g' is printed instead of the FP number. >How-To-Repeat: > sh $ printf "%04d\n" 1 1 $ /usr/bin/printf "%04d\n" 1 0001 $ printf "%4.2g\n" 1.23 g $ /usr/bin/printf "%4.2g\n" 1.23 1.2 $ >Fix: "To know the error means to know the solution." As a temporary fix use /usr/bin/printf via alias: alias printf=/usr/bin/printf $ printf "%4.2f\n" 1.2 f $ alias printf=/usr/bin/printf $ printf "%4.2f\n" 1.2 1.20 $ >Audit-Trail: >Unformatted: