Mercurial > repo
diff bin/pastelog @ 2257:5c453217583b
<Jafet> sed -i... -e \'s/grep/timeout 25 grep/\' bin/pastelog
author | HackBot |
---|---|
date | Tue, 26 Feb 2013 18:01:53 +0000 |
parents | e037173e0012 |
children | be90d778a82d |
line wrap: on
line diff
--- a/bin/pastelog Tue Feb 26 17:53:02 2013 +0000 +++ b/bin/pastelog Tue Feb 26 18:01:53 2013 +0000 @@ -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]"