Mercurial > repo
changeset 2263:a0b194e05edd
<Jafet> rm bin/pastelogs && ln -s pastelog bin/pastelogs
author | HackBot |
---|---|
date | Tue, 26 Feb 2013 18:10:10 +0000 |
parents | 00d09531128c |
children | 4430bdc0547c |
files | bin/pastelogs |
diffstat | 1 files changed, 1 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- 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