![]() |
|
|
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 |
| Date in Perl | Raynon | Shell Programming and Scripting | 3 | 11-09-2008 05:27 AM |
| Date Formating in Perl | Raynon | Shell Programming and Scripting | 3 | 09-08-2008 11:23 AM |
| date converion using perl | akil | Shell Programming and Scripting | 7 | 06-18-2008 06:30 AM |
| Perl: Extracting date from file name and comparing with current date | MKNENI | Shell Programming and Scripting | 4 | 03-26-2008 04:01 PM |
| getting the date fields in Perl | jyotipg | Shell Programming and Scripting | 2 | 01-31-2005 12:32 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
date in perl
im having trouble with this... i can do it in awk but perl is giving me trouble.
i want to test for the previous 3 days, today, and the coming three days. heres the code: #!/usr/bin/perl chomp($info=`date +%b%d`); $info =~ tr/[A-Z]/[a-z]/; if ($info =~ m/^([a-z]*)([0-9])$/) { $info = "$1.0.$2"; } #above date is stored in "list" as mmmdd, "jun04" etc. #followed by other info divided by spaces. open(FILE, "list"); close(@file=<FILE>); $count = 0; while ($file[$count] ne "") { if ($file[$count] =~ $info) { print $file[$count]; } $count++; } finished. any ideas on how to test for the week span, instead of just today? thanks in advance if you can help. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|