The scenario is, I have a bunch of wavelog files with the file names being... wavelog.20020422 (todays date)
The problem I am having with is, I'm trying to delete files that are older than seven days using the date format at the end of the filename. Here is what I have so far,
#!/bin/ksh
+2
+3 ##Variables##
+4 date1=`date +%Y%m%d`
+5 date2=`expr $date1`
+6 less=$(($date2 - 7))
+7 less1=$(($less - 1 ))
+8 ##Script##
+9
+10 cd /dso/mis/scripts/delhislog
+11 while [ "wavelog.$date2" => "wavelog.$less" ]
+12 do rm wavelog.$less
+13
+14 done
+15
+16
I am getting a test: argument expected on line 11 and I can't figure out why. Can someone help?
The problem I am having with is, I'm trying to delete files that are older than seven days using the date format at the end of the filename. Here is what I have so far,
#!/bin/ksh
+2
+3 ##Variables##
+4 date1=`date +%Y%m%d`
+5 date2=`expr $date1`
+6 less=$(($date2 - 7))
+7 less1=$(($less - 1 ))
+8 ##Script##
+9
+10 cd /dso/mis/scripts/delhislog
+11 while [ "wavelog.$date2" => "wavelog.$less" ]
+12 do rm wavelog.$less
+13
+14 done
+15
+16
I am getting a test: argument expected on line 11 and I can't figure out why. Can someone help?