zsh-users
 help / color / mirror / code / Atom feed
* Rounding of glob qualifiers?
@ 2010-07-23 20:09 Benjamin R. Haskell
  2010-07-26  9:13 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin R. Haskell @ 2010-07-23 20:09 UTC (permalink / raw)
  To: Zsh Users

The rounding seems a bit odd here:

## some files less than, equal to, and greater than 1024 bytes
$ ls -l {lt,eq,gt}-1k
-rw------- 1 bhaskell users 1023 2010-07-23 16:08 lt-1k
-rw------- 1 bhaskell users 1024 2010-07-23 16:08 eq-1k
-rw------- 1 bhaskell users 1025 2010-07-23 16:08 gt-1k

## why does lt-1k match here:
$ print -l *-1k(L-1024)
lt-1k

## and here:
$ print -l *-1k(Lk1)
eq-1k
lt-1k

## but not here?
$ print -l *-1k(Lk-1)
zsh: no matches found: *-1k(Lk-1)


Not claiming it's a 'bug', per se, but what's the rationale for rounding 
up?  Seems similar to the 'a' glob qualifier caveat with 'whole units', 
but I didn't see an explanation similar to fractional-part-is-discarded 
for 'L'.  Did I overlook it?

(Discovered while trying to grep for something in files <1K -- which 
only matched files of size 0.  There's probably a case where this 
behavior is preferable.)

-- 
Best,
Ben


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

end of thread, other threads:[~2010-07-26  9:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-23 20:09 Rounding of glob qualifiers? Benjamin R. Haskell
2010-07-26  9:13 ` Peter Stephenson

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).