 |
|
 |
| |
Developer on focus
Anton Zamov is a dipl. engineer with more than 6 years of active professional
experience and many awards ...
read more>>
|
|
 |
 |
 |
|
 |
|
 |
| |
|
How to create a program whose input is a piped in directory command and whose output is stdout, and whose output represents a batch file which copies every file (not directory) older than specific date?
|
while(<STDIN>)
{
my($line) = $_;
chomp($line);
if($line !~ /<DIR>/) #directories don't count
{
#** only lines with dates at position 28 and (long) filename at pos 44 **
if ($line =~ /.{28}(\\d\\d)-(\\d\\d)-(\\d\\d).{8}(.+)$/)
{
my($filename) = $4;
my($yymmdd) = "$3$1$2";
if($yymmdd lt "971222")
{
print "copy $filename \\\\oldie\\n";
}
}
}
}
|
About the author of this programming example or tutorial:
Anton Zamov is a software engineer with more than6 years
of active experience in web and software development and design.
Anton Zamov has extensive experience and broad knowledgebase
in C# and JAVA programming and has created a lot of
running e-commerce systems, portals and content management
systems using PHP and other web development technologies.
For more information about Anton Zamov, you may visit the personal web site of
Anton Zamov.
|
|
|
 |
 |
 |
|
|