# HG changeset patch # User HackBot # Date 1358850479 0 # Node ID 69c3cce98e53eff8eb1ecfe30f357bc3f008be90 # Parent c9dec74a72e71e748cba2d2d7abe8fe37ae4a9e5 mv bin/seen2 bin/seen # meh, good enough diff -r c9dec74a72e7 -r 69c3cce98e53 bin/seen --- a/bin/seen Tue Jan 22 10:26:15 2013 +0000 +++ b/bin/seen Tue Jan 22 10:27:59 2013 +0000 @@ -1,2 +1,2 @@ -#!/bin/sh -ls -r /var/irclogs/_esoteric/????-??-??.txt | while read -r file; do awk -vf="$(basename "$file" .txt)" -vs="^..:..:..: <${1% }>" '$0 ~ s{x=$0} END{if(!x) exit 1; print f,x}' "$file" && break; done +#! /usr/bin/env perl +$n=shift @ARGV; $n=~s/ *$//; @f=split /\s+/, `ls -r /var/irclogs/_esoteric/????-??-??.txt | head -n 30`; for $f (@f) { open F,"<$f"; @l=grep(/^..:..:..: <$n>/i,); close F; if (@l) { $b=$f; $b=~s#.*/(.*?).txt#$1#; print "$b $l[-1]"; exit 1; } } print "not lately"; diff -r c9dec74a72e7 -r 69c3cce98e53 bin/seen2 --- a/bin/seen2 Tue Jan 22 10:26:15 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -#! /usr/bin/env perl -$n=shift @ARGV; $n=~s/ *$//; @f=split /\s+/, `ls -r /var/irclogs/_esoteric/????-??-??.txt | head -n 30`; for $f (@f) { open F,"<$f"; @l=grep(/^..:..:..: <$n>/i,); close F; if (@l) { $b=$f; $b=~s#.*/(.*?).txt#$1#; print "$b $l[-1]"; exit 1; } } print "not lately";