view paste/paste.18999 @ 1762:ac79507c118d

<Jafet> echo -e \'#!/bin/sh\\ntopic=$(echo "$1" | tr A-Z a-z | sed "s/ *$//")\\n([ "$topic" = "ngevd" && -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:13:51 +0000
parents ab2c49f31e97
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