Skip to content

Instantly share code, notes, and snippets.

@pete
Created May 7, 2015 00:14
Show Gist options
  • Save pete/c9ae330c678d9e4a02ba to your computer and use it in GitHub Desktop.
Save pete/c9ae330c678d9e4a02ba to your computer and use it in GitHub Desktop.
#!/dis/sh
load std regex
drx = '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]'
cfn = `{ls tw-days|sort -r|sed 1q}
dn = `{basename $cfn .log}
echo -n > $cfn
sed -n (
'/^! day changed, ' ^ $dn ^ '/,$ { s///g; s/$/\n/; p; }'
'./#twitter_1337p337.log' ) |
grep -v '^#' |
uniq |
fmt -l80 |
getlines {
and {match '^! day changed, ' ^ $drx $line} {
cfn = tw-days/ ^ ${re m $drx $line} ^ .log
echo $line
}
echo $line >> $cfn
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment