![]() |
|
|
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 |
| Perl parameter passing between scripts | coolbhai | Shell Programming and Scripting | 3 | 02-23-2009 04:38 AM |
| passing a hash to another script in perl | ammu | Shell Programming and Scripting | 2 | 01-07-2009 05:15 AM |
| Passing Value from Shell to Perl | hcbhatt | Shell Programming and Scripting | 5 | 11-05-2007 02:31 PM |
| Passing variable to perl | TheCrunge | Shell Programming and Scripting | 2 | 06-06-2006 05:43 PM |
| Passing arguments to a Perl script | jyoung | Shell Programming and Scripting | 4 | 12-29-2004 05:57 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Passing date formats in Perl: i.e. Jul/10/2007 -> 20070710 (yyyymmdd) - Perl
Hi , This script working for fine if pass script-name.sh Jul/10/2007 ,I want to pass 20070710(yyyymmdd) .Please any help it should be appereciated. Code:
use Time::Local;
my $d = $ARGV[0];
my $t = $ARGV[1];
my $m = "";
@d = split /\//, $d;
@t = split /:/, $t;
if ( $d[0] eq "Jan" ) { $m = 0 }
elsif ( $d[0] eq "Feb" ) { $m = 1 }
elsif ( $d[0] eq "Mar" ) { $m = 2 }
elsif ( $d[0] eq "Apr" ) { $m = 3 }
elsif ( $d[0] eq "May" ) { $m = 4 }
elsif ( $d[0] eq "Jun" ) { $m = 5 }
elsif ( $d[0] eq "Jul" ) { $m = 6 }
elsif ( $d[0] eq "Aug" ) { $m = 7 }
elsif ( $d[0] eq "Sep" ) { $m = 8 }
elsif ( $d[0] eq "Oct" ) { $m = 9 }
elsif ( $d[0] eq "Nov" ) { $m = 10 }
elsif ( $d[0] eq "Dec" ) { $m = 11 };
$time = timelocal($t[2], $t[1], $t[0], $d[1], $m, $d[2]);
print "$time\n";usage :
Thank, Akil |
| Bits Awarded / Charged to akil for this Post | |||
| Date | User | Comment | Amount |
| 07-16-2009 | Neo | Changed subject text for poster. | -5,000 |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|