![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| calculate the date of next satureday of current date. | rinku | Shell Programming and Scripting | 3 | 2 Days Ago 08:05 PM |
| Get date and time for past 1 hour from current date | spch2o | Shell Programming and Scripting | 5 | 1 Week Ago 01:32 AM |
| Extracting date-time from file. | skumar11 | Shell Programming and Scripting | 7 | 09-06-2007 01:45 PM |
| File date vs Current date | trexlim | Shell Programming and Scripting | 4 | 05-04-2007 06:35 PM |
| how to give current date in file name? | simurg11 | UNIX for Dummies Questions & Answers | 3 | 05-10-2005 06:09 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Perl: Extracting date from file name and comparing with current date
I need to extract the date part from the file name (20080221 in this ex) and compare it with the current date and delete it, if it is a past date.
$file = exp_ABCD4_T-2584780_upto_20080221.dmp.Z really appreciate any help. thanks mkneni |
| Forum Sponsor | ||
|
|
|
|||
|
Code:
if ($friendly_dancing_file_name =~ m/(\d+)\./) {
print "oh goody, looks like the file's date is $1\n";
print "abort, return, continue, are you sure?\n";
<>;
}
|
|||
| Google UNIX.COM |