changeset 1660:b8970773f9ca

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