[Perl-unix-users] Removing a set of consecutive file names from a directory

2003-12-01 Thread Craig Sharp
It sounds simple but here is the situation. I have DB2 creating log files. Each file name is consecutive. Eg: S628.LOG S629.LOG S630.LOG S631.LOG S632.LOG S633.LOG S634.LOG S635.LOG S636.LOG S637.LOG S638.LOG S639.LOG S640.LOG The DBA wants m

Re: [Perl-unix-users] Removing a set of consecutive file names from a directory

2003-12-01 Thread $Bill Luebkert
Craig Sharp wrote: > It sounds simple but here is the situation. > > I have DB2 creating log files. Each file name is consecutive. > > Eg: > > S628.LOG > S629.LOG > S630.LOG > S631.LOG > S632.LOG > S633.LOG > S634.LOG > S635.LOG > S636.LOG > S637.LOG > S

Re: [Perl-unix-users] Removing a set of consecutive file names from a directory

2003-12-01 Thread $Bill Luebkert
Craig Sharp wrote: > It sounds simple but here is the situation. > > I have DB2 creating log files. Each file name is consecutive. > > Eg: > > S628.LOG > S629.LOG > S630.LOG > S631.LOG > S632.LOG > S633.LOG > S634.LOG > S635.LOG > S636.LOG > S637.LOG > S

RE: [Perl-unix-users] Removing a set of consecutive file names from a directory

2003-12-01 Thread Matt Schneider
You could do something like this: # get a list of log files somehow @logs = `ls *.log`; # remove the new lines from the end of each element due to # the way I generated the list chomp @logs; # make sure the list is in order @logs = sort @logs; # remove all but the last 10 archive log files and the

Re: [Perl-unix-users] Removing a set of consecutive file names froma directory

2003-12-01 Thread Craig Sharp
Bill, Can you please give and example? Thanks, Craig >>> "$Bill Luebkert" <[EMAIL PROTECTED]> 12/01/03 09:29AM >>> Craig Sharp wrote: > It sounds simple but here is the situation. > > I have DB2 creating log files. Each file name is consecutive. > > Eg: > > S628.LOG > S629.LOG > S0

Re: [Perl-unix-users] Removing a set of consecutive file names froma directory

2003-12-01 Thread $Bill Luebkert
Craig Sharp wrote: > Bill, > > Can you please give and example? Nope - not today. I'm forcing people to read the man pages today. perlfunc man page functions: opendir, readdir, closedir, grep, splice, sort, unlink perlre/perlretut man pages to learn about regular expressions. An example of