Mercurial > repo
changeset 1616:69c3cce98e53
<fizzie> mv bin/seen2 bin/seen # meh, good enough
author | HackBot |
---|---|
date | Tue, 22 Jan 2013 10:27:59 +0000 |
parents | c9dec74a72e7 |
children | eb7a076d0498 |
files | bin/seen bin/seen2 |
diffstat | 2 files changed, 2 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- 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,<F>); close F; if (@l) { $b=$f; $b=~s#.*/(.*?).txt#$1#; print "$b $l[-1]"; exit 1; } } print "not lately";
--- 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,<F>); close F; if (@l) { $b=$f; $b=~s#.*/(.*?).txt#$1#; print "$b $l[-1]"; exit 1; } } print "not lately";