Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Unix Command to separate this years files and last years? Post 302431336 by DallasT on Monday 21st of June 2010 02:53:04 PM
Old 06-21-2010
This is good.. till i put 2010 and it shows 0. Although i have 2010 files..

And is there a way for me to break month by month..
 

9 More Discussions You Might Find Interesting

1. Cybersecurity

Unix attacks in the last 5 years.

Hi, Could anyone direct me to any sites that have any info on unix attcks or hacks in the last 5 years. This is needed for an assignment. All help would be greatly appreciated. Thanks:) (6 Replies)
Discussion started by: suzant
6 Replies

2. UNIX for Dummies Questions & Answers

Archiving Files by selecting years file created

I have recently taken on a new position and want to clean up several file locations that currently hold data back through 1999. While I need to keep this data for business reasons, I have created directories to help sort out the individual years. Is there a quick command that I can use to archive... (2 Replies)
Discussion started by: dmhammond
2 Replies

3. Shell Programming and Scripting

Easy unix/sed question that I could have done 10 years ago!

Hi all and greetings from Ireland! I have not used much unix or awk/sed in years and have forgotten a lot. Easy enough query tho. I am cleansing/fixing 10,000 postal addresses using global replacements. I have 2 pipe delimited files , one is basically a spell checker for geographical... (4 Replies)
Discussion started by: dewsbury
4 Replies

4. Shell Programming and Scripting

unix korn shell leap years problem

Write a function called dateToDays that takes three parameters -a month string such as Sep, a day number such as 18, and a year number such as 1962-and return s the number of days from January 1, 1900, to the date. Notes: I am asking you to account for leap years. my script is not... (0 Replies)
Discussion started by: babuda0059
0 Replies

5. Shell Programming and Scripting

Need to Zip files three years old or longer but leave folder structure intact

Hi all, Hello everyone, my first post here :). I tried to search the forum but I didn't find exactly what I was looking for... I need to zip/tar files across entire filesystem which are more 3+ years old but leave folder structure intact. If the script locates tar/zip files they are more... (1 Reply)
Discussion started by: sashruby
1 Replies

6. UNIX for Dummies Questions & Answers

Interview topics or questions for unix developers with 4.years experience

Hi , I am gonna attend interview this week end for unix developer ( 4.5 years exp) opening .. Can you help me out the topics or the questions which I can expect in the interview. This is may be silly but it is very important to me. Thanks in Advance (5 Replies)
Discussion started by: arukuku
5 Replies

7. UNIX for Dummies Questions & Answers

[Solved] Delete files older than 10 years

I need a command which delete files older than 10 years. I got a command for 90 days and all commands I find are for days and nothing for years. find file_name -mtime +90 -exec rm {} \; (5 Replies)
Discussion started by: eskay
5 Replies

8. What is on Your Mind?

The Great History of UNIX (1969-1999) | 30 Years of UNIX History | YouTube Video

I am pleased to announce this new video in 1080 HD for UNIX lovers honoring thirty years of UNIX history spanning from 1969 to 1999 presented in 150 seconds (two and a half minutes) in 1080 HD, celebrating the 50th anniversary of UNIX. The Great History of UNIX (1969-1999) | 30 Years of UNIX... (8 Replies)
Discussion started by: Neo
8 Replies

9. What is on Your Mind?

The Dark Years of UNIX (2003 - 2011) | A Decade Lost to Legal Battles | YouTube Video

The Dark Years of UNIX (2003 - 2011) | A Decade Lost to Legal Battles | UNIX and Linux Legal Attacks https://youtu.be/ILH5CVYdl8w Here is the second video in the "history of unix" short videos. The first video was on the "great history of UNIX" and this second video covers the "years of... (7 Replies)
Discussion started by: Neo
7 Replies
Time::Local(3pm)					 Perl Programmers Reference Guide					  Time::Local(3pm)

NAME
Time::Local - efficiently compute time from local and GMT time SYNOPSIS
$time = timelocal($sec,$min,$hour,$mday,$mon,$year); $time = timegm($sec,$min,$hour,$mday,$mon,$year); DESCRIPTION
These routines are the inverse of built-in perl functions localtime() and gmtime(). They accept a date as a six-element array, and return the corresponding time(2) value in seconds since the Epoch (Midnight, January 1, 1970). This value can be positive or negative. It is worth drawing particular attention to the expected ranges for the values provided. The value for the day of the month is the actual day (ie 1..31), while the month is the number of months since January (0..11). This is consistent with the values returned from local- time() and gmtime(). The timelocal() and timegm() functions perform range checking on the input $sec, $min, $hour, $mday, and $mon values by default. If you'd rather they didn't, you can explicitly import the timelocal_nocheck() and timegm_nocheck() functions. use Time::Local 'timelocal_nocheck'; { # The 365th day of 1999 print scalar localtime timelocal_nocheck 0,0,0,365,0,99; # The twenty thousandth day since 1970 print scalar localtime timelocal_nocheck 0,0,0,20000,0,70; # And even the 10,000,000th second since 1999! print scalar localtime timelocal_nocheck 10000000,0,0,1,0,99; } Your mileage may vary when trying these with minutes and hours, and it doesn't work at all for months. Strictly speaking, the year should also be specified in a form consistent with localtime(), i.e. the offset from 1900. In order to make the interpretation of the year easier for humans, however, who are more accustomed to seeing years as two-digit or four-digit values, the following conventions are followed: o Years greater than 999 are interpreted as being the actual year, rather than the offset from 1900. Thus, 1963 would indicate the year Martin Luther King won the Nobel prize, not the year 2863. o Years in the range 100..999 are interpreted as offset from 1900, so that 112 indicates 2012. This rule also applies to years less than zero (but see note below regarding date range). o Years in the range 0..99 are interpreted as shorthand for years in the rolling "current century," defined as 50 years on either side of the current year. Thus, today, in 1999, 0 would refer to 2000, and 45 to 2045, but 55 would refer to 1955. Twenty years from now, 55 would instead refer to 2055. This is messy, but matches the way people currently think about two digit dates. Whenever possible, use an absolute four digit year instead. The scheme above allows interpretation of a wide range of dates, particularly if 4-digit years are used. Please note, however, that the range of dates that can be actually be handled depends on the size of an integer (time_t) on a given plat- form. Currently, this is 32 bits for most systems, yielding an approximate range from Dec 1901 to Jan 2038. Both timelocal() and timegm() croak if given dates outside the supported range. IMPLEMENTATION
These routines are quite efficient and yet are always guaranteed to agree with localtime() and gmtime(). We manage this by caching the start times of any months we've seen before. If we know the start time of the month, we can always calculate any time within the month. The start times are calculated using a mathematical formula. Unlike other algorithms that do multiple calls to gmtime(). timelocal() is implemented using the same cache. We just assume that we're translating a GMT time, and then fudge it when we're done for the timezone and daylight savings arguments. Note that the timezone is evaluated for each date because countries occasionally change their official timezones. Assuming that localtime() corrects for these changes, this routine will also be correct. BUGS
The whole scheme for interpreting two-digit years can be considered a bug. The proclivity to croak() is probably a bug. perl v5.8.0 2002-06-01 Time::Local(3pm)
All times are GMT -4. The time now is 11:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy