![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| perl script to add a line into a file | karthikn7974 | Shell Programming and Scripting | 2 | 06-03-2008 02:11 AM |
| help on a perl script to edit file | meghana | Shell Programming and Scripting | 9 | 05-14-2008 03:42 PM |
| perl script for file processing | SEEHTAS | Shell Programming and Scripting | 10 | 03-25-2008 09:02 AM |
| SED/AWK Script to clear log file using timestamp? | davesimm | Linux | 2 | 03-03-2008 07:18 AM |
| grep ^M in file using perl script.... | zedex | Shell Programming and Scripting | 12 | 02-06-2008 08:43 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I have seen this posting here:
perl -e '@d=localtime ((stat(shift))[9]); printf "%02d-%02d-%04d %02d:%02d:%02d\n", $d[3],$d[4]+1,$d[5]+1900,$d[2],$d[1],$d[0]' file1.txt I need to use it inside a perl script. Can anybody please help me out. |
|
||||
|
Quote:
ShawnMilo |
|
||||
|
I copied the whole stamenet along with "perl -e"
Thanks, I copied the whole statement into my perl script , but it is giving synatax error:
syntax error at compare_forms2.pl line 27, near "perl -e " Here is the code i used in my per script: perl -e '@d=localtime ((stat(shift))[9]); printf "%02d-%02d-%04d %02d:%02d:%02d\n", $d[3],$d[4]+1,$d[5]+1900,$d[2],$d[1],$d[0] '$ddt_dir_prod[1]; Where $ddt_dir_prod[1] contains a valid file. |
|
||||
|
Either you're joking, or you have no business writing code today. Please pick up a basic Perl book or read a Web tutorial and let us know when you can write a simple Perl script and understand what it does.
Sincerely, ShawnMilo |
|
||||
|
I apologize for the rudeness of my comment. I know that I sometimes come off more harshly than I mean to, and I also thought that my first post was funny.
But in all seriousness, you don't seem to understand some very basic things, and it wouldn't really help you if we gave you the answers because you wouldn't be able to apply them. Also, you haven't even said what you're trying to accomplish. That makes it nearly impossible for anyone to help you anyway. If you get anything even half-working, post it and someone may be able to help you fix it. But, as I said, it doesn't appear that you know enough Perl (or maybe programming in general) to be making this attempt without further study. ShawnMilo |
![]() |
| Bookmarks |
| Tags |
| perl, perl shift, shift, shift perl |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|