[blfs-dev] bash script
akuktin at gmail.com
Mon Jun 2 09:25:01 PDT 2014
>On Mon, 2 Jun 2014 23:57:40 +1200
>"Christopher Gregory" <me at pc-networking-services.com> wrote:
> The script at:
> which has a few more features than the one on Bruce's SBU page:
> is what I am using, with the program name modified accordingly.
> There has to be a way to just pass the integer value of Elapsed Time
> to a variable without getting the frigging error that it is not an
> integer value.
See below for one approach.
> I know from the research that time outputs to stderr.
This complicates matters somewhat. To say the least..
# ... yada yada yada ...
} 2>&1 | tee $SDIR/logs/$PROGRAM.log
time_elapsed=$(grep 'Elapsed Time' $SDIR/logs/$PROGRAM.log | \
echo "SBU: $(($time_elapsed / $standard_sbu))"
Now, I tried for an hour or two to figure out a way that would redirect
various outputs and inputs via anonymous pipes and produce both the
effect of filling $time_elapsed and also print out the output on the
screen. I failed. Which was really dissapointing because I think that a
system like Linux should be able to do that. But no matter, the
infomation we need is inside the log file, so you just make a second
pass over the log file when all is done and extract the result.
Maybe perl or tlc would be able to do this task better. The fact that
the shell is unable to do what it SHOULD be able to do is quite
Svi moji e-mailovi su kriptografski potpisani. Proverite ih.
All of my e-mails are cryptographically signed. Verify them.
You don't need an AI for a robot uprising.
Humans will do just fine.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: not available
More information about the blfs-dev