view bin/log @ 1768:ce59f2644c41

<Jafet> echo -e \'#!/bin/sh\\ntopic=$(echo "$1" | tr A-Z a-z | sed "s/ *$//")\\n([ \\( "$topic" = "ngevd" \\) -a \\( -e wisdom/ngevd \\) ] && cat /dev/urandom && exit 0; ) || [ -e "wisdom/$topic" ] || { echo "$1? \xc2\xaf\\(\xc2\xb0_o)/\xc2\xaf"; exit 1; }\\ncat "wisdom/$topic"\' > bin/q
author HackBot
date Fri, 25 Jan 2013 13:21:05 +0000
parents e037173e0012
children
line wrap: on
line source

#!/bin/sh
cd /var/irclogs/_esoteric
if [ "$1" ]; then
    grep -P -i -- "$1" ????-??-??.txt | shuf -n 1
else
    file=$(shuf -en 1 ????-??-??.txt)
    echo "$file:$(shuf -n 1 $file)"
fi