RE: Using bc in bash script

2003-08-14 Thread Charles Howse
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/NewOrleans/NOLA. I

RE: Using bc in bash script

2003-08-14 Thread Charles Howse
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 $time cat

Re: Using bc in bash script

2003-08-14 Thread Kirk Strauser
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 guess

RE: Using bc in bash script

2003-08-14 Thread Alexander Haderer
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 in

RE: Using bc in bash script

2003-08-14 Thread Charles Howse
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 time

Re: Using bc in bash script

2003-08-14 Thread Stephen Hilton
of seconds between $start_time and $end_time in a bash script. Start_time=`date +%s` # Seconds past midnight at start of script [ do lots of stuff ] End_time=`date +%s` # Seconds past midnight at end of script Then I want to: et=`bc $end_time - $start_time` to get the number

Re: Using bc in bash script

2003-08-14 Thread Stephen Hilton
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 decimal places:

Re: Using bc in bash script

2003-08-14 Thread Alexander Haderer
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` #

Re: Using bc in bash script

2003-08-14 Thread Jez Hancock
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` Ohhh, I was really hoping on

RE: Using bc in bash script

2003-08-14 Thread Charles Howse
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

SOLVED - Using bc in Bash script

2003-08-14 Thread Charles Howse
Got it going. Instead of running daily_report from cron, I will now run the following: - #!/usr/local/bin/bash # Time and run the Daily_report \time -ho /root/tmp.time ~/bin/daily_report cat /root/tmp.time | cut -f 2 | cut

Re: A little Bash script to help you.

2003-08-11 Thread Dan Nelson
In the last episode (Aug 11), Matthew Graybosch said: On Mon, 2003-08-11 at 17:49, Constantine wrote: I am writing a script, which involves unzipping some files. I would have to unzip 4 different zip-files from some directory, and I would need to unzip them to the directory, which would

<    1   2