I need to create 12 variables, the first of which is the date of the first day of the current month (01/01/2006), and the remaining 11 are to equal each month after the current.
var1 = 01/01/2006
var2 = 02/01/2006
var3 = 03/01/2006
var4 = 04/01/2006
etc.
How can I easily do this is in... (7 Replies)
Hi,
Is there any way I can get the difference between two dates in terms of days?
I have used this method so far, but I cant format it in terms of days.
@a=&DateCalc($date1,$date2,0);
The o/p that I am getting is sort of like this:
+0:0:0:4:0:0:0
I just want to get 4 days as an o/p.... (1 Reply)
Hi,
I need help to toggle through dates on a weekly basis to be fed into a script as inputs. The format should be: yyyy/mm/dd (start) yyyy/mm/dd (end), where end date is 7 days increments.
The date (start) would be input as an ARGV and would continue until current date.
I can check... (2 Replies)
Hi forum.
I'm hoping someone can help me out with this problem. I tried to search online but couldn't come up with an exact solution.
I have the following data file:
H|20-May-2011|MF_FF.dat|77164|731374590.96|1|1|731374590.96|76586|77164|578|2988|Y... (8 Replies)
Hi all,
Not sure if this should be in the programming forum, but I believe it will get more response under the Shell Programming and Scripting FORUM.
Am trying to write a customized df script in Perl and need some help with regards to using arrays and file handlers.
At the moment am... (3 Replies)
Hi guys,
First of all, I would like to say this is my first post in the unix.com forums. I am a beginner in PERL and have only started writing my first scripts.
With that out of the way, I have a question regarding the calculation of time dates in PERL.
I have two scalar variables with the... (1 Reply)
Hi
i have a file containg dates likebelow
4/30/2013
3/31/2013
4/30/2013
4/16/2013
4/30/2013
4/30/2013
5/30/2013
5/30/2013
4/30/2013
5/30/2013
5/30/2013
3/31/2013
now i want to compare the above dates with current date and i want to display the difference . (10 Replies)
Hi All
I have a text file that has a list of dates in it ( see below example) is there i can just pull out the lines that are from this week ( week starting on monday) and then work out the how many occurances there are on each name in collum 2
2013-05-13 08:20:02 bacha ... (8 Replies)
Hello All,
I have two strings with date and time as follows..
$starttime= "06/11/2013 ";
$starttime= "05:15";
$enddate="06/12/2013";
$endtime="04:45";
dates are in mm/dd/yyyy format and time in military format.
and I am looking the duration of time(in minutes) in between dates.
... (3 Replies)
hello folks,
I have a requirement in which I have to calculate the difference of
localdate(today's date) and the given(earlier) date and to check whether the
difference is exactly a year or more than that(can be 1 year or 2 years or 3 years.. ) .
Could anyone please let me know the logic... (2 Replies)
Discussion started by: scriptscript
2 Replies
LEARN ABOUT OSX
dirfd
DIRECTORY(3) BSD Library Functions Manual DIRECTORY(3)NAME
closedir, dirfd, opendir, readdir, readdir_r, rewinddir, seekdir, telldir -- directory operations
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <dirent.h>
int
closedir(DIR *dirp);
int
dirfd(DIR *dirp);
DIR *
opendir(const char *dirname);
struct dirent *
readdir(DIR *dirp);
int
readdir_r(DIR *restrict dirp, struct dirent *restrict entry, struct dirent **restrict result);
void
rewinddir(DIR *dirp);
void
seekdir(DIR *dirp, long loc);
long
telldir(DIR *dirp);
DESCRIPTION
The opendir() function opens the directory named by dirname, associates a directory stream with it, and returns a pointer to be used to iden-
tify the directory stream in subsequent operations. The pointer NULL is returned if dirname cannot be accessed or if it cannot malloc(3)
enough memory to hold the whole thing.
The readdir() function returns a pointer to the next directory entry. It returns NULL upon reaching the end of the directory or detecting an
invalid seekdir() operation.
readdir_r() provides the same functionality as readdir(), but the caller must provide a directory entry buffer to store the results in. If
the read succeeds, result is pointed at the entry; upon reaching the end of the directory, result is set to NULL. readdir_r() returns 0 on
success or an error number to indicate failure.
The telldir() function returns the current location associated with the named directory stream. Values returned by telldir() are good only
for the lifetime of the DIR pointer (e.g., dirp) from which they are derived. If the directory is closed and then reopened, prior values
returned by telldir() will no longer be valid.
The seekdir() function sets the position of the next readdir() operation on the directory stream. The new position reverts to the one asso-
ciated with the directory stream when the telldir() operation was performed.
The rewinddir() function resets the position of the named directory stream to the beginning of the directory.
The closedir() function closes the named directory stream and frees the structure associated with the dirp pointer, returning 0 on success.
On failure, -1 is returned and the global variable errno is set to indicate the error.
The dirfd() function returns the integer file descriptor associated with the named directory stream, see open(2).
Sample code which searches a directory for entry ``name'' is:
len = strlen(name);
dirp = opendir(".");
while ((dp = readdir(dirp)) != NULL)
if (dp->d_namlen == len && !strcmp(dp->d_name, name)) {
(void)closedir(dirp);
return FOUND;
}
(void)closedir(dirp);
return NOT_FOUND;
LEGACY SYNOPSIS
#include <sys/types.h>
#include <dirent.h>
<sys/types.h> is necessary for these functions.
SEE ALSO close(2), lseek(2), open(2), read(2), compat(5), dir(5)HISTORY
The closedir(), dirfd(), opendir(), readdir(), rewinddir(), seekdir(), and telldir() functions appeared in 4.2BSD.
BSD June 4, 1993 BSD