view bin/log @ 2383:1f455af23894

<Jafet> (echo \'#!/bin/sh\'; echo \'if [ $# -ne 0 ]; then for f in "$@"; do echo "#!/bin/cat" && cat "$f"; done; else echo "#!/bin/cat" && cat; fi\') > bin/makequine && chmod +x bin/makequine
author HackBot
date Wed, 06 Mar 2013 14:46:16 +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