view bin/anonlog @ 11579:977eb86d5521 draft

<oerjan> learn NVG is a student computer club in Trondheim, whose servers are frequently infiltrated by oerjan. Not to be confused with nvd.
author HackEso <hackeso@esolangs.org>
date Mon, 18 Jun 2018 00:58:34 +0100
parents ee2e8950bb3c
children
line wrap: on
line source

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