zsh-workers
 help / color / mirror / code / Atom feed
* Re:  More about ${(l:e::s1::s2:)param}
@ 1998-11-16  9:14 Sven Wischnowsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 1998-11-16  9:14 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> 
> 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?

The doc. At least what you get is what I intended when I added this
(we had some real-world example for the use of this at the time, but I 
don't remember it anymore).

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 2+ messages in thread

* More about ${(l:e::s1::s2:)param}
  1998-11-04 21:34 Arithmetic expression (bug?) Phil Pennock
@ 1998-11-15 23:25 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 1998-11-15 23:25 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-11-16  9:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-16  9:14 More about ${(l:e::s1::s2:)param} Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
1998-11-04 21:34 Arithmetic expression (bug?) Phil Pennock
1998-11-15 23:25 ` More about ${(l:e::s1::s2:)param} Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).