view paste/paste.18999 @ 6950:70e3abb6d6fa

<ais523> le/rn cat introduction/cat introduction is the process of piping one or more extra `cat` commands into your pipeline; occasionally this is even actually useful
author HackBot
date Wed, 24 Feb 2016 06:07:01 +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