Skip to content

Instantly share code, notes, and snippets.

@grodzik
Created April 15, 2010 08:50
Show Gist options
  • Save grodzik/366858 to your computer and use it in GitHub Desktop.
Save grodzik/366858 to your computer and use it in GitHub Desktop.
#!/bin/bash
#[ -n $1 ] || exit 1
file=$1
timestamp=`date +%s`
sed '/__utm./d' -i $file
IFS="
"
tmp=`mktemp`
for x in `cat $file`
do
t=`echo $x|awk '{ print $5 }'|sed -n 's/^\([[:blank:]]*[0-9]\+[[:blank:]]*\)$/\1/p'`
if [ -z "$t" -o $((t-timestamp)) -gt 0 ]
then
echo $x >> $tmp
fi
done
cp $tmp $file
rm $tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment