From owner-freebsd-questions@FreeBSD.ORG Wed Nov 17 15:50:06 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 3B0DC1065673; Wed, 17 Nov 2010 15:50:06 +0000 (UTC) Date: Wed, 17 Nov 2010 15:50:06 +0000 From: Alexander Best To: freebsd-questions@freebsd.org Message-ID: <20101117155006.GA88394@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: a question regarding proper printf(3) formating and alignment X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Nov 2010 15:50:06 -0000 hi there, i've looked at a lot of utilities in the bsd src tree and most of them seem to be doing something like this: Device 1M-blocks Used Avail Capacity /dev/label/swapfs 10239 0 10239 0% /dev/label/swap 8191 0 8191 0% Total 18431 0 18431 0% as you can see the header simply gets written with a number of tabs in between the keywords, but then the actual output aligns differently. i'd like to learn of ways formatting the header so that it aligns properly, whether the device name is 10 chars long or 1000. is there an example for this somewhere in the src tree? thanks in advance. cheers. alex -- a13x