#!/bin/sh # irclogs -- small script to get only the messages from logs set -e die() { echo "$*" 1>&2 exit 1 } LOGS=/home/_soju/logs [ -z "$1" ] && die "usage: $0 CHANNEL" [ ! -d "$LOGS/$USER" ] && die "User $USER doesn't appear to have a soju account" [ ! -d "$LOGS/$USER/irc.libera.chat/#$1" ] && die "channel #$1 doesn't have any logs" # cd into the log dir as a cheap way to truncate output cd "$LOGS/$USER/irc.libera.chat/#$1" grep '^\[[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\] *<' *.log