From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6053 invoked from network); 15 Nov 1998 23:27:21 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 15 Nov 1998 23:27:21 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id SAA04642; Sun, 15 Nov 1998 18:26:49 -0500 (EST) Resent-Date: Sun, 15 Nov 1998 18:26:49 -0500 (EST) From: "Bart Schaefer" Message-Id: <981115152525.ZM30094@candle.brasslantern.com> Date: Sun, 15 Nov 1998 15:25:25 -0800 In-Reply-To: <199811042134.VAA01156@athenaeum.demon.co.uk> Comments: In reply to Phil Pennock "Arithmetic expression (bug?)" (Nov 4, 9:34pm) References: <199811042134.VAA01156@athenaeum.demon.co.uk> X-Mailer: Z-Mail (4.0b.820 20aug96) To: zsh-workers@math.gatech.edu Subject: More about ${(l:e::s1::s2:)param} MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"cDFNC2.0.T81.vCsJs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4645 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu The info says: `l:'EXPR`::'STRING1`::'STRING2`:' Pad the resulting words on the left. Each word will be truncated if required and placed in a field EXPR characters wide. The space to the left will be filled with STRING1 (concatenated as often as needed) or spaces if STRING1 is not given. If both STRING1 and STRING2 are given, this string will be placed exactly once directly to the left of the resulting word. `r:'EXPR`::'STRING1`::'STRING2`:' As `l', but pad the words on the right. Apparently "the resulting word" is "the word before padding with STRING1": zagzig<1> foo=77 zagzig<2> print -- ${(l:5::0::x:)foo} 00x77 zagzig<3> print -- ${(r:5::0::x:)foo} 77x00 The doc phrasing led me to expect x00077 and 77000x. What needs fixing, the doc or the code? -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com