I've got a bunch of history files with this naming convention.
hislog.20030301
hislog.20030228
As you can see, these are history files with a date on the end as an expression. I'm trying to remove all files that are 7 days or older using this expression at the end of the file name. I'm getting an error of a test unknown operator on line 10. Please help. Here is my script.
#!/bin/ksh
##Variables##
date1=`date +%Y%m%d`
date2=`expr $date1`
less=$(($date2 - 7))
##Script##
cd /dso/mis/scripts/delhislog
if [ *.* =< *.$less1 ]
then rm
fi
exit
I'm having problems with my if statement and was wondering if someone could help me out. Thanks a lot.
Jason Alge
hislog.20030301
hislog.20030228
As you can see, these are history files with a date on the end as an expression. I'm trying to remove all files that are 7 days or older using this expression at the end of the file name. I'm getting an error of a test unknown operator on line 10. Please help. Here is my script.
#!/bin/ksh
##Variables##
date1=`date +%Y%m%d`
date2=`expr $date1`
less=$(($date2 - 7))
##Script##
cd /dso/mis/scripts/delhislog
if [ *.* =< *.$less1 ]
then rm
fi
exit
I'm having problems with my if statement and was wondering if someone could help me out. Thanks a lot.
Jason Alge