From owner-freebsd-questions Sun Dec 22 16: 1:25 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D9E3537B401 for ; Sun, 22 Dec 2002 16:01:24 -0800 (PST) Received: from smtp2.mbox.com.au (203-134-146-019.cust.pth.iprimus.net.au [203.134.146.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6315743EDE for ; Sun, 22 Dec 2002 16:01:23 -0800 (PST) (envelope-from bsd-freak@mbox.com.au) Received: from nms2.mbox.com.au (webmail.mbox.com.au [192.168.20.4]) by smtp2.mbox.com.au (Sun Internet Mail Server sims.4.0.2000.05.17.04.13.p6) with ESMTP id <0H7J00M1PP0MBL@smtp2.mbox.com.au> for freebsd-questions@FreeBSD.ORG; Mon, 23 Dec 2002 07:53:10 +0800 (WST) Received: from mbox.com.au ([127.0.0.1]) by nms2.mbox.com.au (Netscape Messaging Server 4.15) with ESMTP id H7JP7J01.2TD for ; Mon, 23 Dec 2002 07:57:19 +0800 Date: Mon, 23 Dec 2002 10:57:19 +1100 From: BSD Freak Subject: Padding expr output To: FreeBSD Questions Message-id: <108151f107bf32.107bf32108151f@mbox.com.au> MIME-version: 1.0 X-Mailer: Netscape Webmail Content-type: text/plain; charset=us-ascii Content-language: en Content-disposition: inline Content-transfer-encoding: 7BIT X-Accept-Language: en Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi all, I am usiung expr in a shell script and need to pad it's output to always be 3 characters. An example will explain thing better: % expr 007 + 1 Output is 8 I need the output to be 008 I checked the expr man page, but nothing there solves my problem. Anyone out there got one? Thanks in advance.... --------------------------------------------------------------------- Would you like to receive faxes to your personal email address? You can with mBox. Visit http://www.mbox.com.au/fax To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message