Mercurial > repo
comparison gMba @ 1662:5038cea562dc
<c00kiemon5ter> fetch http://sprunge.us/gMba
author | HackBot |
---|---|
date | Tue, 22 Jan 2013 15:15:24 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1661:07fab9f1f557 | 1662:5038cea562dc |
---|---|
1 #!/usr/bin/env bash | |
2 trap 'kill -TERM 0' EXIT | |
3 | |
4 read s <<< "$1" | |
5 files=(/var/irclogs/_esoteric/????-??-??.txt) | |
6 line= | |
7 | |
8 for i in "${!files[@]}" | |
9 do { | |
10 file="${files[${#files[@]} - i - 1]}" | |
11 while read -r t n m | |
12 do [[ $n =~ $s ]] && line="$t $n $m" | |
13 done <"$file" | |
14 } & done | |
15 | |
16 wait | |
17 | |
18 [[ -n "$line" ]] \ | |
19 && { printf '%s:%s\n' "${file##*/}" "$line"; exit;} \ | |
20 || echo 'well, not lately' | |
21 |