#/bin/sh

find /www/wwwroot/ -name *.js >/tmp/js.txt


n=17
while read line
do
	var=`cat $line | grep 'setcookie'`
	if [ ! -z "$var" ]
	then
		nums=`cat $line | wc -l`
		echo "$line file line count $nums"
		let start=$nums-$n
		echo $start
		sed -i "${start},${nums}d" $line	
    	sed -i 's/function setcookie(){//g' $line
	fi
	
done < /tmp/js.txt