I was hoping someone could help me out a little bit. I have a script that I got off a web page to trim older log files but I can't get it to work and I don't know enough about scripting to debug it myself. it says there are errors in lines 9 and 16 but those are my 2 'do' lines. I'm assuming that this means that there is an issue within my 'do' command but I don't know what. I am also guessing that it is in the date portion of the script but I don't know how I should do it differently (or fill it in). Can you help? here's my script:

#!/bin/sh
#trim-log-files
cd /var/log || exit 1
for i in $(find . –type f –maxdepth 1)
do
filename=$(echo $i | sed `s?^./(.*)?1?`)
cp –p $i old/$(date +%Y%m%d`).$filename
> $i
done
cd /var/log/httpd || exit 2
for i in $(find . –type f –maxdepth 1)
do
filename=echo $i | sed `s? ^./(.*)?1?`)
cp –p $i old/$(date +`%Y%m%d`).$filename
> $i
done


Please let me know if you have anything!! Thanks in advance.