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
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
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
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
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
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