![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| calculate the date of next satureday of current date. | rinku | Shell Programming and Scripting | 3 | 09-02-2008 11:05 PM |
| Get date and time for past 1 hour from current date | spch2o | Shell Programming and Scripting | 5 | 08-29-2008 04:32 AM |
| Extracting date-time from file. | skumar11 | Shell Programming and Scripting | 7 | 09-06-2007 04:45 PM |
| File date vs Current date | trexlim | Shell Programming and Scripting | 4 | 05-04-2007 09:35 PM |
| how to give current date in file name? | simurg11 | UNIX for Dummies Questions & Answers | 3 | 05-10-2005 09:09 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | 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 |
|
||||
|
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";
<>;
}
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|