OK, I've been playing with the time command to get the elapsed time of
my daily_report script reported in 2 decimal places.
If I do:
# \time -ha ~/daily.log ~/bin/daily_report (append output of time to
~/daily.log)
I get:
Time: /root/daily.log permission denied
(time output)
If I do:
# chmod 666
On Thu, Aug 14, 2003 at 12:23:34PM -0500, Stephen Hilton wrote:
> On Thu, 14 Aug 2003 12:11:55 -0500
> "Charles Howse" <[EMAIL PROTECTED]> wrote:
>
> > > Charles,
> > >
> > > This will set bc precision to 5 decimal places:
> > >
> > > et=`echo "scale=5 ; $end_time - $start_time" | bc`
> >
> > O
> > Can I refine it to give me something like: .784 seconds?
>
> Use "bc -l" instead of bc. That should do it.
No, that still gives 0 seconds.
I think this whole thing is dependent on the fact that `date +%s`
reports integers.
I'm still interested in something like .874 seconds, but for the ti
At 11:45 14.08.2003 -0500, Charles Howse wrote:
> > Can I refine it to give me something like: .784 seconds?
>
> Use "bc -l" instead of bc. That should do it.
No, that still gives 0 seconds.
I think this whole thing is dependent on the fact that `date +%s`
reports integers.
I'm still interested i
I received this msg a short time ago:
Antigen for Exchange found daily_report.sh matching =*.sh file filter.
The file is currently Removed. The message, "RE: Using bc in bash
script",
was
sent from Charles Howse and was discovered in IMC Queues\Inbound
located at mcglinchey/NewOr
At 11:35 14.08.2003 -0500, Kirk Strauser wrote:
At 2003-08-14T16:08:21Z, "Charles Howse" <[EMAIL PROTECTED]> writes:
> Can I refine it to give me something like: .784 seconds?
Use "bc -l" instead of bc. That should do it.
Yes, but not in the context mentioned before:
> > > Start_time=`date +%s`
On Thu, Aug 14, 2003 at 10:46:45AM -0500, Charles Howse wrote:
> Hello List,
>
> I've migrated from Redhat Linux 9 to FreeBSD 4.8-RELEASE, character mode
> - no gui.
>
> I'm trying to calculate the number of seconds between $start_time and
> $end_time in a bash script.
>
> Start_time=`date +%s`
On Thu, 14 Aug 2003 11:08:21 -0500
"Charles Howse" <[EMAIL PROTECTED]> wrote:
> > On Thu, Aug 14, 2003 at 10:46:45AM -0500, Charles Howse wrote:
> > > Hello List,
> > >
> > > I've migrated from Redhat Linux 9 to FreeBSD 4.8-RELEASE,
> > character mode
> > > - no gui.
> > >
> > > I'm trying to c
> > The precision is in hundredths of a second as I understand it from
> > playing with time(!):
> >
> > #!/bin/sh
> > time_file=tmp.time
> > time="time -a -o $time_file"
> > $time cat /var/log/messages >/dev/null 2>&1
> > $time cat /var/log/maillog >/dev/null 2>&1
> > awk '{sum+=$1}END{print sum}
On Thu, 14 Aug 2003 18:34:25 +0100
Jez Hancock <[EMAIL PROTECTED]> wrote:
> On Thu, Aug 14, 2003 at 12:23:34PM -0500, Stephen Hilton wrote:
> > On Thu, 14 Aug 2003 12:11:55 -0500
> > "Charles Howse" <[EMAIL PROTECTED]> wrote:
> >
> > > > Charles,
> > > >
> > > > This will set bc precision to 5 d
At 2003-08-14T16:08:21Z, "Charles Howse" <[EMAIL PROTECTED]> writes:
> Can I refine it to give me something like: .784 seconds?
Use "bc -l" instead of bc. That should do it.
--
Kirk Strauser
pgp0.pgp
Description: PGP signature
On Thu, 14 Aug 2003 12:11:55 -0500
"Charles Howse" <[EMAIL PROTECTED]> wrote:
> > Charles,
> >
> > This will set bc precision to 5 decimal places:
> >
> > et=`echo "scale=5 ; $end_time - $start_time" | bc`
>
> Ohhh, I was really hoping on that one...but no, it still reports 0
> seconds.
Sorry
On Thu, Aug 14, 2003 at 12:58:01PM -0500 or thereabouts, Stephen Hilton wrote:
> On Thu, 14 Aug 2003 18:34:25 +0100
> Jez Hancock <[EMAIL PROTECTED]> wrote:
>
> > On Thu, Aug 14, 2003 at 12:23:34PM -0500, Stephen Hilton wrote:
> > > On Thu, 14 Aug 2003 12:11:55 -0500
> > > "Charles Howse" <[EMAIL
At 2003-08-14T17:58:01Z, Stephen Hilton <[EMAIL PROTECTED]> writes:
> I still am wondering why the date command does not have a format string
> for seconds (down to 100th's) like "+%ss" and also why the time command
> stops at 100th's when other programs resolve time to 5 or 6 decimal places?
My
> > > Sorry I jumped the gun there, the scale is needed for
> this to work
Not a problem, thanks for working with me!
> > The precision is in hundredths of a second as I understand it from
> > playing with time(!):
> >
> > #!/bin/sh
> > time_file=tmp.time
> > time="time -a -o $time_file"
> > $
At 2003-08-14T16:45:56Z, "Charles Howse" <[EMAIL PROTECTED]> writes:
> I think this whole thing is dependent on the fact that `date +%s` reports
> integers.
As his daughter says, "DUUUH"! I only saw the $end_time and $start_time
variables, and not their origins. I'll go back to lurking now.
On Thu, Aug 14, 2003 at 11:08:21AM -0500, Charles Howse wrote:
> > On Thu, Aug 14, 2003 at 10:46:45AM -0500, Charles Howse wrote:
> > > Hello List,
> > >
> > > I've migrated from Redhat Linux 9 to FreeBSD 4.8-RELEASE,
> > character mode
> > > - no gui.
> > >
> > > I'm trying to calculate the num
> Charles,
>
> This will set bc precision to 5 decimal places:
>
> et=`echo "scale=5 ; $end_time - $start_time" | bc`
Ohhh, I was really hoping on that one...but no, it still reports 0
seconds.
Maybe there's something in the script itself that's messing this up.
Here is the entire script:
#!/
> I'm trying to calculate the number of seconds between $start_time and
> $end_time in a bash script.
Bash has built-in integer arithmetic:
et=$[End_time - Start_time]
-- Richard
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/lis
In the last episode (Aug 14), Richard Tobin said:
> > I'm trying to calculate the number of seconds between $start_time and
> > $end_time in a bash script.
>
> Bash has built-in integer arithmetic:
>
> et=$[End_time - Start_time]
Most bourne-based shells have arithmetic evaluation. For portab
> On Thu, Aug 14, 2003 at 10:46:45AM -0500, Charles Howse wrote:
> > Hello List,
> >
> > I've migrated from Redhat Linux 9 to FreeBSD 4.8-RELEASE,
> character mode
> > - no gui.
> >
> > I'm trying to calculate the number of seconds between
> $start_time and
> > $end_time in a bash script.
> >
21 matches
Mail list logo