diff bin/pastelog @ 4531:7f957c1f4661

<oerjan> revert
author HackBot
date Sun, 16 Mar 2014 01:52:15 +0000
parents 03afb1619ef2
children
line wrap: on
line diff
--- a/bin/pastelog	Sun Mar 16 01:51:13 2014 +0000
+++ b/bin/pastelog	Sun Mar 16 01:52:15 2014 +0000
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 cd /var/irclogs/_esoteric
 
 pasterandom() {
@@ -16,7 +16,7 @@
     if expr "$1" + 0 >/dev/null 2>&1; then
         pasterandom "$1"
     else
-        lines=$(grep -P -i -- "$1" ????-??-??.txt | head -n 301)
+        lines=$(timeout 25 grep -P -i -- "$1" ????-??-??.txt | head -n 301)
         {
             echo "$lines" | head -n 300
             [ $(echo "$lines" | wc -l) -eq 301 ] && echo "[too many lines; stopping]"