From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8882 invoked from network); 12 Mar 2004 11:29:43 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 12 Mar 2004 11:29:43 -0000 Received: (qmail 749 invoked by alias); 12 Mar 2004 11:29:09 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7158 Received: (qmail 736 invoked from network); 12 Mar 2004 11:29:07 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 12 Mar 2004 11:29:07 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [193.109.254.211] by sunsite.dk (MessageWall 1.0.8) with SMTP; 12 Mar 2004 11:29:7 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-12.tower-36.messagelabs.com!1079090946!4560169 X-StarScan-Version: 5.2.5; banners=-,-,- X-Originating-IP: [158.234.9.163] Received: (qmail 21554 invoked from network); 12 Mar 2004 11:29:06 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-12.tower-36.messagelabs.com with SMTP; 12 Mar 2004 11:29:06 -0000 Received: from trentino.logica.co.uk ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id i2CBT5Ck022784; Fri, 12 Mar 2004 11:29:05 GMT Received: from trentino.logica.co.uk (localhost [127.0.0.1]) by trentino.logica.co.uk (Postfix) with ESMTP id 680B179721C1; Fri, 12 Mar 2004 12:28:21 +0100 (CET) Cc: zsh-users@sunsite.dk X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <1mm7og67rpkdy.dlg@thorstenkampe.de> From: Oliver Kiddle References: <1mm7og67rpkdy.dlg@thorstenkampe.de> To: Thorsten Kampe Subject: Re: Justifying text output Date: Fri, 12 Mar 2004 12:28:21 +0100 Message-ID: <30391.1079090901@trentino.logica.co.uk> Thorsten Kampe wrote: > I wrote a little script[1] that compiles the main zsh config files. Is > there any way to make the "[ ok ]"/"[ failed ]" messages on the right > justified? I'll add a third way, also compatible with ksh: using printf. printf "${ltred}* ${white}%-60s [ ${ltred}failed${white} ]\n" "ERROR: $file - file not readable" They key bit is the '%-60s' in the format string which tells it to print the string right justified with a width of 60 spaces. Oliver