bug-bash
[Top][All Lists]
Advanced

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

Re: handling of ints/longs


From: Paul Jarc
Subject: Re: handling of ints/longs
Date: Thu, 11 Jul 2002 14:13:42 -0400
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i686-pc-linux-gnu)

"roberto@" <address@hidden> wrote:
> We have a bunch of things that depend on timestamp files, the
> contents of which are generated by something like:
>
> /bin/date +%Y%m%d%H%M%S

%s would give you the plain time_t value, which would fit in a long
int.  But you still might need to work with old timestamp files, so
this won't help with those.

> Is there anything I can do to change the behaviour of bash back to
> what it was (we actually invoke it as /bin/sh)?

Use the old version of bash.  Alternatively, you could treat the
values as strings instead of integers, and compare them as such.
Since they all have the same number of digits, and the units are
ordered from most significant to least, lexicographic comparison
should give the right results.  Another option would be to use a
different scripting language - one with built-in bignum facilities.


paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]