Still some quirks below, like adjusting start & end times to 900 or 1800 (your input example was outside this range). However, perhaps this gives you a basis to begin thinking about a process.
Code:
curr_day = day1
while [ curr_day .le day2 ]
do
if [ day_of_wk in {MTWTF} ]
then
#assume full day; hours in hundreds; over-write as needed
day_hr=900
if [ curr_day .eq day1 ]
then
day_hr=(1800 - day1(hr))
fi
if [ curr_day .eq day2 ]
then
day_hr=(day2(hr) - 900)
fi
hr_tot=(hr_tot + day_hr)
fi
curr_day=(curr_day+1)
done
I extract dates from the log file and need to calculate days between two dates. My dates are in yyyyMmmdd format. Example:
$d1=2011 Oct 21
$d2=2012 Feb 20
I need to calculate the number of days between $d2 and $d1. This is on Solaris.
Any ideas?
Thanks,
djanu (4 Replies)
I wrote the day calculator also in bash. I would like to now, that is it good so?
#!/bin/bash
datum1=`date -d "1991/1/1" "+%s"`
datum2=`date "+%s"`
diff=$(($datum2-$datum1))
days=$(($diff/(60*60*24)))
echo $days
Thanks in advance for your help! (3 Replies)
I want the difference between two following date using scripts in terms of no.of days. How I can accomplish this.
lastdate=Tue Nov 13 10:30:56 2012
currdate=Wed Dec 15 15:58:21 PAKST 2012
Ouput should be like this:
Your Password will expire after = 32 Days on Wed Dec 15 15:58:21 PAKST... (1 Reply)
Hi,
how to calculate the time difference between PST date and PDT date in perl scripting.
date1: Mon Dec 31 16:00:01 PST 2015
date2: Tue Mar 19 06:09:30 PDT 2013
and also difference between PST-PST and PDT-PDT
need difference in months or days (months prefereble). (3 Replies)
I have to fetch files from a location hour wise.
Eg files available at location /tmp/data/ are
A20140205.1300-1315......
.
.
A20140205.1400-1415......
.
.
A20140205.1700-1715......
.
.
.
.
Below is the code I have prepared.
But it works only for one hour.
For instance... (1 Reply)
Hello,
I have a question please,
How could I get ALL update dates and hours of a file ?
For example:
I modified a file on 09/04/2014 at 7:am for the first time. Then, I modified again the same file on 09/04/2014 at 9 am and finally, I modified the same file again on 10/04/2014 at... (3 Replies)
I have two dates in below format, how would I find the hours difference between the two dates. Im using AIX and ksh.
Current date : Wed May 17 14:34:41 SGT 2017
File date : Thu Apr 27 20:52:41 SGT 2017 (3 Replies)
Objective: We have multiple files in a folder and we want to delete all files except for last 1 week files.
Note: We are copying these files from original location to this temporary location. So time shown for these files are time when we copied to this location. Not that when file was created.... (2 Replies)
Discussion started by: Agoyals1986
2 Replies
LEARN ABOUT NETBSD
sip
SIP(4) BSD Kernel Interfaces Manual SIP(4)NAME
sip -- SiS 900-based Ethernet driver
SYNOPSIS
sip* at pci? dev ? function ?
Configuration of PHYs is also necessary. See mii(4).
DESCRIPTION
The sip device driver supports Ethernet interfaces based on the Silicon Integrated Systems SiS 900, SiS 7016, and National Semiconductor
DP83815 Ethernet chips.
The SiS 900 is found on many motherboards featuring SiS chipsets, and on some embedded systems, and has a built-in PHY. The SiS 7016 is an
older version of the chip, which uses an external PHY.
The National Semiconductor DP83815 is found on NetGear FA-311 and FA-312 Ethernet boards, and has a built-in PHY.
SEE ALSO arp(4), ifmedia(4), mii(4), netintro(4), pci(4), ifconfig(8)HISTORY
The sip driver first appeared in NetBSD 1.5.
AUTHORS
The sip driver was originally written by Jason R. Thorpe for Network Computer, Inc.
It has since been modified by Jason R. Thorpe <thorpej@NetBSD.org> and Allen Briggs <briggs@NetBSD.org>.
BSD May 17, 2001 BSD