changeset 1662:5038cea562dc

<c00kiemon5ter> fetch http://sprunge.us/gMba
author HackBot
date Tue, 22 Jan 2013 15:15:24 +0000
parents 07fab9f1f557
children 49ddc1acbea0
files gMba
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gMba	Tue Jan 22 15:15:24 2013 +0000
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+trap 'kill -TERM 0' EXIT
+
+read s <<< "$1"
+files=(/var/irclogs/_esoteric/????-??-??.txt)
+line=
+
+for i in "${!files[@]}"
+do {
+	file="${files[${#files[@]} - i - 1]}"
+	while read -r t n m
+	do [[ $n =~ $s ]] && line="$t $n $m"
+	done <"$file"
+} & done
+
+wait
+
+[[ -n "$line" ]] \
+	&& { printf '%s:%s\n' "${file##*/}" "$line"; exit;} \
+	|| echo 'well, not lately'
+