PATCH: SBU method change and bc removal.

Dan Nicholson dbn.lists at gmail.com
Thu May 24 06:27:48 PDT 2007


On 5/24/07, Ag. D. Hatzimanikas <a.hatzim at gmail.com> wrote:
> On Thu, May 24, at 10:47 Ag. D. Hatzimanikas wrote:
> > Please review it carefully (especially the common/libs/func_validate_configs.sh)
>
> Correction: I was talking about common/libs/func_wrt_Makefile of course.

One slightly bad thing happening there is that the build commands used
to be run in a dedicated subshell ( ). With that, any variables set
wouldn't leak to the parent process. Wait. That doesn't matter since
make is running all commands in a their own dedicated shell anyway.
Nevermind.

One other thing to think about is that we lose resolution when we just
use whole seconds. But, that can be recovered if we use the %N
modifier from date.

$ date +%s.%N
1180012692.545891184
$ start=`date +%s.%N`
$ ...
$ end=`date +%s.%N`
$ perl -e "printf \"Time: %.3f\n\", ($end - $start)"
Time: 24.432

But, the same thing could be done with time and a proper TIMEFORMAT
variable. So, I think that the using perl instead of bc is a win.
Using perl instead of time doesn't really gain anything, though. When
I'd originally written that, it was because we were trying to figure
out how to use dash, which doesn't have a time builtin. But, just
forcing bash makes things easier.

--
Dan



More information about the alfs-discuss mailing list