[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: second-one-billion-bug ?

On Sun, Feb 24, 2002 at 10:31:36PM +0100, Jonathan Schmitt wrote:
> I think I have (with some delay) located a second one billion bug.
> When searching for the newest version of one file with a little script, I 
> used the date command (with options -r,+%s).
> The result was not, as expected, the latest file, but the latest with a time 
> less than one billion. This one isn't of course a native second one billion 
> problem but more a problem of the bash-tests. As this hasn't been done on a 
> debian system (but bash 2.05a). Perhaps anyone can verify this is also 
> present on debian systems (I'm currently far far away from a running one)?

If I am following you correctly, this is probably a sorting problem. 
Sort the times as ctimes in numerical, not alphabetical order. Since:

	99999999 < 1000000000
	"999999999" > "1000000000"

Where "" indicates a string. In perl (and I know you're using bash), the 
difference is `sort ($a $b)` (default alphabetical) versus 
`sort {$a <=> $b} ($a $b)` (numerical).

What exact command did you use?



 James Bromberger <james_AT_rcpt.to> www.james.rcpt.to
 Remainder moved to http://www.james.rcpt.to/james/sig.html

Attachment: pgpypZiuoVkLq.pgp
Description: PGP signature

Reply to: