# HG changeset patch # User HackBot # Date 1361902210 0 # Node ID a0b194e05edd5f4dd2d93caac36c7ddd55f9fa97 # Parent 00d09531128cda0ac0d699df45d9e57ec622fb1c rm bin/pastelogs && ln -s pastelog bin/pastelogs diff -r 00d09531128c -r a0b194e05edd bin/pastelogs --- a/bin/pastelogs Tue Feb 26 18:07:03 2013 +0000 +++ b/bin/pastelogs Tue Feb 26 18:10:10 2013 +0000 @@ -1,28 +1,1 @@ -#!/bin/sh -cd /var/irclogs/_esoteric - -pasterandom() { - if [ "$1" -gt 150 ]; then - echo "No." - exit - fi - for i in $(seq "$1"); do - file=$(shuf -en 1 ????-??-??.txt) - echo "$file:$(shuf -n 1 $file)" - done | paste -} - -if [ "$1" ]; then - if expr "$1" + 0 >/dev/null 2>&1; then - pasterandom "$1" - else - lines=$(grep -P -i -- "$1" ????-??-??.txt | head -n 301) - { - echo "$lines" | head -n 300 - [ $(echo "$lines" | wc -l) -eq 301 ] && echo "[too many lines; stopping]" - } | paste - fi -else - pasterandom 40 -fi - +pastelog \ No newline at end of file