view bin/gaseen @ 10412:5af59ff5ca72

<hppavilion[1]> learn zed is the 26th letter of the alphabet in Commonwealth English. Why they consider what is clearly a 3-letter string to be a single letter is unclear.
author HackBot
date Wed, 15 Mar 2017 00:47:06 +0000
parents 7b39af120554
children
line wrap: on
line source

#!/bin/bash
who="${1% }" who="${who,,}"
arr=(/var/irclogs/_esoteric/????-??-??.txt)
gawk -vw="$who" -vOFS=":" '
tolower($2) ~ w{x=$0} ENDFILE{if(x){print substr(FILENAME,1,10), x; exit}}
' < <(for ((i=${#arr[@]}-1; i>=0; i-- )); do echo ${arr[i]}; done)