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